Celery 是一个异步任务队列。你可以使用它在你的应用上下文之外执行任务。总的想法就是你的应用程序可能需要执行任何消耗资源的任务都可以交给任务队列,让你的应用程序自由和快速地响应客户端请求。

使用 Celery 运行后台任务并不像在线程中这样做那么简单。但是好处多多,Celery 具有分布式架构,使你的应用易于扩展,celery可以支持多进程并发执行。
Celery的特点
1.简单:一单熟悉了celery的工作流程后,配置和使用还是比较简单的
2.高可用:当任务执行失败或执行过程中发生连接中断,celery 会自动尝试重新执行任务
3.快速:一个单进程的celery每分钟可处理上百万个任务
3.灵活: 几乎celery的各个组件都可以被扩展及自定制

现在的服务器性能都比较牛逼,CPU核都比较多,内存和CPU以及硬盘上W的服务器都可以配置很不错,对于运算比较多的,可以充分利用多核CPU,同时开启多个进程实现并发运算。和python里面的multiprocessing 中的进程池差不多

from multiprocessing import Pool
import  os,time,threading
from datetime import  datetime
def fun(*args,**kwargs):print(f"线程名称:{threading.current_thread().getName()},线程ID:{threading.get_ident()},进程ID:{os.getpid()}")time.sleep(5)print(f"args value is:{args},kwargs value is:{kwargs}")print(f"now is {datetime.now()}")if __name__=='__main__':pool=Pool(5)for i in range(11):pool.apply_async(fun,(i,),kwds={'i':i})pool.close()pool.join()print("结束运行")

运行结果

线程名称:MainThread,线程ID:140563724695360,进程ID:13820
线程名称:MainThread,线程ID:140563724695360,进程ID:13821
线程名称:MainThread,线程ID:140563724695360,进程ID:13822
线程名称:MainThread,线程ID:140563724695360,进程ID:13823
线程名称:MainThread,线程ID:140563724695360,进程ID:13819
args value is:(0,),kwargs value is:{'i': 0}
now is 2022-06-14 17:23:25.760127
线程名称:MainThread,线程ID:140563724695360,进程ID:13820
args value is:(1,),kwargs value is:{'i': 1}
now is 2022-06-14 17:23:25.760374
线程名称:MainThread,线程ID:140563724695360,进程ID:13821
args value is:(2,),kwargs value is:{'i': 2}
now is 2022-06-14 17:23:25.760548
线程名称:MainThread,线程ID:140563724695360,进程ID:13822
args value is:(3,),kwargs value is:{'i': 3}
now is 2022-06-14 17:23:25.760717
线程名称:MainThread,线程ID:140563724695360,进程ID:13823
args value is:(4,),kwargs value is:{'i': 4}
now is 2022-06-14 17:23:25.760885
线程名称:MainThread,线程ID:140563724695360,进程ID:13819
args value is:(5,),kwargs value is:{'i': 5}
now is 2022-06-14 17:23:30.765400
线程名称:MainThread,线程ID:140563724695360,进程ID:13820
args value is:(6,),kwargs value is:{'i': 6}
now is 2022-06-14 17:23:30.765545
args value is:(7,),kwargs value is:{'i': 7}
now is 2022-06-14 17:23:30.765615
args value is:(8,),kwargs value is:{'i': 8}
now is 2022-06-14 17:23:30.765679
args value is:(9,),kwargs value is:{'i': 9}
now is 2022-06-14 17:23:30.765739
args value is:(10,),kwargs value is:{'i': 10}
now is 2022-06-14 17:23:35.770320
结束运行

同时开5个并发,处理起来速度很快
celery也是采用类似机制做的使用的是
业内的常见方案叫 prefork,预生成方案。预生成指的是,主进程在执行具体的业务逻辑之前,先提前 fork 出来一堆子进程,并把他们存起来集中管理,形成一个进程池。平常的时候这些子进程都是 休眠(asleep) 状态,只有当主进程派发任务的时候,会唤醒(awake)其中的一个子进程,并通过进程间通讯,向子进程传输相应的任务数据。
如果不使用预生成,会有什么问题?每当一个任务到来,主进程都会去临时产生一个子进程,复制一份上下文数据,然后传输任务给这个子进程。当子进程执行后,主进程再去销毁掉这个子进程的所有上下文数据。频繁的对内存数据进行操作,上下文切换,会导致系统的性能很差。所以预生成的方式更优。
默认情况下celery开的并发数等于cpu的核数,我这里为了更好的验证性能采用参数-c 的方式增加并发数
运行命令:

/virtual/python38/bin/celery -A celerydemo.celery worker -E -c 20 --loglevel=info

下面看下我的flask相关文件

创建一个Apschedule包,因为里面包括了__init__.py文件,所以这是一个python的包,否则就是模块
settings.py文件内容

import  os,sys
from datetime  import timedelta
from celery import schedules
from apscheduler.jobstores.sqlalchemy import SQLAlchemyJobStore
basedir = os.path.abspath(os.path.dirname(__file__))
DIALECT = 'mysql'
DRIVER = 'pymysql'
USERNAME = 'dbadmin'   # 改为自己的数据库用户名
PASSWORD = 'dbadmin'   # 改为自己的数据库密码
HOST = '192.168.56.104'
PORT = 3306
DATABASE = 'celeryapp'   # 改为自己新建的schema名
JSONIFY_MIMETYPE="application/json;charset=utf-8"
JSON_AS_ASCII=False
SQLALCHEMY_DATABASE_URI = "{}+{}://{}:{}@{}:{}/{}".format(DIALECT, DRIVER, USERNAME, PASSWORD, HOST, PORT, DATABASE)
SQLALCHEMY_TRACK_MODIFICATIONS = False
SECRET_KEY = os.urandom(24)
# 如果数据库修改了下面的schedule,beat重启后数据库会被下面的配置覆盖
beat_schedule = {'echo-every-3-seconds': {'task': 'celerydemo.echo','schedule': timedelta(seconds=3),'args': ('hello', )},'add-every-minutes': {'task': 'celerydemo.add','schedule': schedules.crontab('*', '*', '*'),'args': (1, 2)},
}class Config(object):# -------持久化配置---------# job存储位置SCHEDULER_JOBSTORES = {'default': SQLAlchemyJobStore(url=SQLALCHEMY_DATABASE_URI)}SCHEDULER_EXECUTORS = {'default': {'type': 'threadpool', 'max_workers': 20}}SCHEDULER_JOB_DEFAULTS = {'coalesce': False,'max_instances': 5}# 调度器开关SCHEDULER_API_ENABLED = TrueCELERY_RESULT_BACKEND='redis://192.168.56.104:6380/1'CELERY_BROKER_URL='redis://192.168.56.104:6380/0'BEAT_DBURI=SQLALCHEMY_DATABASE_URItimezone = 'Asia/Shanghai'beat_scheduler = 'celery_sqlalchemy_scheduler.schedulers:DatabaseScheduler'beat_sync_every = 0beat_schedule = beat_schedulebeat_scheduler = beat_schedulerworker_max_tasks_per_child = 10beat_max_loop_interval = 10
class DevelopmentConfig(Config):passclass ProductionConfig(Config):pass

celeryinit.py文件内容(这个主要是让让celery和flask app关联起来的文件),代码参照:基于 Celery 的后台任务结合Flask

from celery import Celery
import  settings
def make_celery(app):celery = Celery('celerydemo',# app.import_name,backend=app.config['CELERY_RESULT_BACKEND'],broker=app.config['CELERY_BROKER_URL'])# celery.conf.update(app.config)celery.conf.update(dict(# beat_schedule=settings.Config.beat_schedule,beat_scheduler=settings.Config.beat_scheduler,beat_max_loop_interval=settings.Config.beat_max_loop_interval,beat_dburi=settings.Config.BEAT_DBURI,timezone=settings.Config.timezone,worker_max_tasks_per_child=settings.Config.worker_max_tasks_per_child))# {'beat_dburi': app.config['BEAT_DBURI']}class ContextTask(celery.Task):def __call__(self, *args, **kwargs):with app.app_context():return self.run(*args, **kwargs)celery.Task = ContextTaskreturn celery

上面的代码已经把clery和flask app关联起来了,为什么还要使用celery.conf.update(dict=(…))这行代码而不是上面的celery.conf.update(app.config)代码,可以通过命令print(app.config)命令找出里面的配置项,有些配置flask是读不出来的,不报错但是app.config中没有
celerydemo.py文件内容

from celeryinit import make_celery
from flask import  Flask,jsonify
import settings
import os,threadingapp=Flask(__name__)
app.config.from_object('settings.Config')
celery=make_celery(app)
from time import  sleep
@celery.task(bind=True)
def my_task1(self):"""Background task that runs a long function with progress reports."""verb = ['Starting up', 'Booting', 'Repairing', 'Loading', 'Checking']adjective = ['master', 'radiant', 'silent', 'harmonic', 'fast']noun = ['solar array', 'particle reshaper', 'cosmic ray', 'orbiter', 'bit']sleep(5)print(f"刚才睡了5秒钟,运行线程名称:{threading.current_thread().getName()},运行线程ID:{threading.get_ident()},进程ID:{os.getpid()}")self.update_state(state='PROGRESS', meta={'progress': 25})sleep(5)print(f"刚才睡了5秒钟,运行线程名称:{threading.current_thread().getName()},运行线程ID:{threading.get_ident()},进程ID:{os.getpid()}")self.update_state(state='PROGRESS', meta={'progress': 50})sleep(5)print(f"刚才睡了5秒钟,运行线程名称:{threading.current_thread().getName()},运行线程ID:{threading.get_ident()},进程ID:{os.getpid()}")self.update_state(state='PROGRESS', meta={'progress': 75})sleep(5)print(f"刚才睡了5秒钟,运行线程名称:{threading.current_thread().getName()},运行线程ID:{threading.get_ident()},进程ID:{os.getpid()}")return "程序运行结束"
@app.route('/index')
def index():my_task1.delay()return "hello world"
@app.route('/status/<task_id>')
def get_task_status(task_id):task=celery.AsyncResult(id=task_id)if task.state == 'PENDING':response = {'state': task.state,'status': 'Pending...'}elif task.state != 'FAILURE' and 'PROGRESS' in task.info:response = {'state': task.state,'progress': task.info.get('PROGRESS', 0)}else:if  task.state == 'SUCCESS':response = {'state': task.state,'progress': 100,  # this is the exception raised}# something went wrong in the background jobelse:response = {'state': task.state,'progress': str(task.info),  # this is the exception raised}return jsonify(f"当前进度为:{response}")
@celery.task()
def add(x, y):return x + y@celery.task()
def echo(data):print(data)if __name__=='__main__':app.run(host='192.168.56.104',debug=True)

里面有个task(bind=True)命令,这个写了下面定义函数可以使用self,里面可以获取自己的状态之类的,类似于python的类和实例,如果可视化进度的时候也可以通过上面的progress来展示,反应程序执行进度预测程序历史执行时间。结合前端可以让数据更明白直观,这里不做过多介绍,感兴趣自行了解
init.py文件采用默认值啥都没写
下面开始跑程序运行flask主函数程序

运行celery
我们的消息储存和消息处理结果都采用redis保存,内存比硬盘更快所以我们采用了内存来处理,但是需要注意的一点是redis采用aof或者dump.rdb存储数据正常关闭程序没得问题,但是一旦异常关闭,可能会造成消息的重复应用,这点一定要注意

(python38) [root@mysql04 Apschedule]# celery -A celerydemo.celery worker -E  --loglevel=info
/virtual/python38/lib/python3.8/site-packages/celery/utils/imports.py:165: UserWarning: Cannot load celery.commands extension 'flower.command:flower': ImportError("cannot import name 'CeleryCommand' from 'celery.bin.base' (/virtual/python38/lib/python3.8/site-packages/celery/bin/base.py)")warnings.warn(
/virtual/python38/lib/python3.8/site-packages/celery/platforms.py:800: RuntimeWarning: You're running the worker with superuser privileges: this is
absolutely not recommended!Please specify a different user using the --uid option.User information: uid=0 euid=0 gid=0 egid=0warnings.warn(RuntimeWarning(ROOT_DISCOURAGED.format(-------------- celery@mysql04 v4.3.0 (rhubarb)
---- **** -----
--- * ***  * -- Linux-3.10.0-1160.24.1.el7.x86_64-x86_64-with-glibc2.17 2022-06-15 10:15:47
-- * - **** ---
- ** ---------- [config]
- ** ---------- .> app:         celerydemo:0x7efe4a19db80
- ** ---------- .> transport:   redis://192.168.56.104:6380/0
- ** ---------- .> results:     redis://192.168.56.104:6380/1
- *** --- * --- .> concurrency: 1 (prefork)
-- ******* ---- .> task events: ON
--- ***** ----- -------------- [queues].> celery           exchange=celery(direct) key=celery[tasks]. celerydemo.add. celerydemo.echo. celerydemo.my_task1[2022-06-15 10:15:47,409: INFO/MainProcess] Connected to redis://192.168.56.104:6380/0
[2022-06-15 10:15:47,415: INFO/MainProcess] mingle: searching for neighbors
[2022-06-15 10:15:48,430: INFO/MainProcess] mingle: all alone
[2022-06-15 10:15:48,437: INFO/MainProcess] celery@mysql04 ready.

因为我们的虚拟机就一个cpu所以并发数也就是1,和cpu的核数相同,perfork也就只有一个

可以看到2105衍生出来只有一个子进程
下面我们开20个并发

(python38) [root@mysql04 Apschedule]# celery -A celerydemo.celery worker -E  -c 20  --loglevel=info
/virtual/python38/lib/python3.8/site-packages/celery/utils/imports.py:165: UserWarning: Cannot load celery.commands extension 'flower.command:flower': ImportError("cannot import name 'CeleryCommand' from 'celery.bin.base' (/virtual/python38/lib/python3.8/site-packages/celery/bin/base.py)")warnings.warn(
/virtual/python38/lib/python3.8/site-packages/celery/platforms.py:800: RuntimeWarning: You're running the worker with superuser privileges: this is
absolutely not recommended!Please specify a different user using the --uid option.User information: uid=0 euid=0 gid=0 egid=0warnings.warn(RuntimeWarning(ROOT_DISCOURAGED.format(-------------- celery@mysql04 v4.3.0 (rhubarb)
---- **** -----
--- * ***  * -- Linux-3.10.0-1160.24.1.el7.x86_64-x86_64-with-glibc2.17 2022-06-15 10:29:32
-- * - **** ---
- ** ---------- [config]
- ** ---------- .> app:         celerydemo:0x7fee0da88fd0
- ** ---------- .> transport:   redis://192.168.56.104:6380/0
- ** ---------- .> results:     redis://192.168.56.104:6380/1
- *** --- * --- .> concurrency: 20 (prefork)
-- ******* ---- .> task events: ON
--- ***** ----- -------------- [queues].> celery           exchange=celery(direct) key=celery[tasks]. celerydemo.add. celerydemo.echo. celerydemo.my_task1[2022-06-15 10:29:33,227: INFO/MainProcess] Connected to redis://192.168.56.104:6380/0
[2022-06-15 10:29:33,234: INFO/MainProcess] mingle: searching for neighbors
[2022-06-15 10:29:34,250: INFO/MainProcess] mingle: all alone
[2022-06-15 10:29:34,255: INFO/MainProcess] celery@mysql04 ready.

上面的可以看到concurrency:20 perfork进程

linux命令一样可以得到2231作为父进程和进程ID一共出现了21次,验证了我们的结论
通过flask提供的url,我们在网页前端发起请求

不间断的多次发出请求,看队列处理情况
内容太长了,整合一部分发出来

[2022-06-15 10:36:29,122: WARNING/ForkPoolWorker-16] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2248
[2022-06-15 10:36:29,123: INFO/ForkPoolWorker-16] Task celerydemo.my_task1[82b7e827-82ab-4e01-9458-2f2176b20a33] succeeded in 20.0228110449998s: '程序运行结束'
[2022-06-15 10:36:29,272: WARNING/ForkPoolWorker-17] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2249
[2022-06-15 10:36:29,273: INFO/ForkPoolWorker-17] Task celerydemo.my_task1[15c3e8cb-7ff9-4cd9-8967-54afdb2aeb67] succeeded in 20.022248663000028s: '程序运行结束'
[2022-06-15 10:36:29,436: WARNING/ForkPoolWorker-18] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2250
[2022-06-15 10:36:29,437: INFO/ForkPoolWorker-18] Task celerydemo.my_task1[b80464e2-cef3-49c4-a28e-2e3c43f1cbef] succeeded in 20.025135695000245s: '程序运行结束'
[2022-06-15 10:36:29,596: WARNING/ForkPoolWorker-19] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2251
[2022-06-15 10:36:29,597: INFO/ForkPoolWorker-19] Task celerydemo.my_task1[c8d2ba0b-ad9c-4428-ba35-60ea7042cf52] succeeded in 20.025347924000016s: '程序运行结束'
[2022-06-15 10:36:29,741: WARNING/ForkPoolWorker-20] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2252
[2022-06-15 10:36:29,741: INFO/ForkPoolWorker-20] Task celerydemo.my_task1[ccea04ca-ec3d-4618-b4ab-eade9f40e703] succeeded in 20.024985654000375s: '程序运行结束'
[2022-06-15 10:36:29,898: WARNING/ForkPoolWorker-6] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2238
[2022-06-15 10:36:29,898: INFO/ForkPoolWorker-6] Task celerydemo.my_task1[12d1fbab-c61e-4528-9373-b35d1b480f79] succeeded in 20.019815106999886s: '程序运行结束'
[2022-06-15 10:36:30,031: WARNING/ForkPoolWorker-8] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2240
[2022-06-15 10:36:30,031: INFO/ForkPoolWorker-8] Task celerydemo.my_task1[1ed1aed6-a32e-48bd-912b-531804547b26] succeeded in 20.01078867399974s: '程序运行结束'
[2022-06-15 10:36:30,200: WARNING/ForkPoolWorker-10] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2242
[2022-06-15 10:36:30,201: INFO/ForkPoolWorker-10] Task celerydemo.my_task1[87612c31-8643-4c62-b5d0-f42c56f09b16] succeeded in 20.017402126999514s: '程序运行结束'
[2022-06-15 10:36:30,350: WARNING/ForkPoolWorker-13] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2245
[2022-06-15 10:36:30,351: INFO/ForkPoolWorker-13] Task celerydemo.my_task1[86260948-e394-4369-abd4-18074b990aae] succeeded in 20.019175268000254s: '程序运行结束'
[2022-06-15 10:36:30,518: WARNING/ForkPoolWorker-1] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2233
[2022-06-15 10:36:30,519: INFO/ForkPoolWorker-1] Task celerydemo.my_task1[a54fa946-f7bd-44b7-9b8f-1688fc305d92] succeeded in 20.024604805999843s: '程序运行结束'
[2022-06-15 10:36:30,663: WARNING/ForkPoolWorker-3] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2235
[2022-06-15 10:36:30,664: INFO/ForkPoolWorker-3] Task celerydemo.my_task1[84c3a49f-3f5c-453f-acb6-165027b06f8e] succeeded in 20.028584831000444s: '程序运行结束'
[2022-06-15 10:36:30,839: WARNING/ForkPoolWorker-5] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2237
[2022-06-15 10:36:30,840: INFO/ForkPoolWorker-5] Task celerydemo.my_task1[13316a11-77c5-4527-a45a-0fb9300eca7f] succeeded in 20.028032402000463s: '程序运行结束'
[2022-06-15 10:36:31,000: WARNING/ForkPoolWorker-9] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2241
[2022-06-15 10:36:31,001: INFO/ForkPoolWorker-9] Task celerydemo.my_task1[e4cf3c30-3b5e-409c-b3b6-d573a54a81d1] succeeded in 20.027905594000003s: '程序运行结束'
[2022-06-15 10:36:31,150: WARNING/ForkPoolWorker-15] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2247
[2022-06-15 10:36:31,151: INFO/ForkPoolWorker-15] Task celerydemo.my_task1[61292fa1-14e8-4683-b92f-5bd9d24e8953] succeeded in 20.026991981999345s: '程序运行结束'
[2022-06-15 10:36:31,307: WARNING/ForkPoolWorker-4] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2236
[2022-06-15 10:36:31,308: INFO/ForkPoolWorker-4] Task celerydemo.my_task1[644a22af-d183-41ae-9aa2-d2e026ea539b] succeeded in 20.023102805000235s: '程序运行结束'
[2022-06-15 10:36:31,494: WARNING/ForkPoolWorker-11] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2243
[2022-06-15 10:36:31,495: INFO/ForkPoolWorker-11] Task celerydemo.my_task1[50df80ec-2615-4b48-a95c-d627f9c0934d] succeeded in 20.027871650000634s: '程序运行结束'
[2022-06-15 10:36:31,638: WARNING/ForkPoolWorker-7] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2239
[2022-06-15 10:36:31,639: INFO/ForkPoolWorker-7] Task celerydemo.my_task1[54793aa5-caba-41e0-b2f4-34ce386e12b0] succeeded in 20.018616577999637s: '程序运行结束'
[2022-06-15 10:36:31,823: WARNING/ForkPoolWorker-2] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2234
[2022-06-15 10:36:31,824: INFO/ForkPoolWorker-2] Task celerydemo.my_task1[6800a13a-6926-494f-828b-95c72e633807] succeeded in 20.026151443000344s: '程序运行结束'
[2022-06-15 10:36:33,781: WARNING/ForkPoolWorker-12] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2244
[2022-06-15 10:36:33,962: WARNING/ForkPoolWorker-14] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2246
[2022-06-15 10:36:34,129: WARNING/ForkPoolWorker-16] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2248
[2022-06-15 10:36:34,280: WARNING/ForkPoolWorker-17] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2249
[2022-06-15 10:36:34,439: WARNING/ForkPoolWorker-18] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2250
[2022-06-15 10:36:34,601: WARNING/ForkPoolWorker-19] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2251
[2022-06-15 10:36:34,748: WARNING/ForkPoolWorker-20] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2252
[2022-06-15 10:36:34,901: WARNING/ForkPoolWorker-6] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2238
[2022-06-15 10:36:35,035: WARNING/ForkPoolWorker-8] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2240
[2022-06-15 10:36:35,208: WARNING/ForkPoolWorker-10] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2242
[2022-06-15 10:36:35,357: WARNING/ForkPoolWorker-13] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2245
[2022-06-15 10:36:35,525: WARNING/ForkPoolWorker-1] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2233
[2022-06-15 10:36:35,671: WARNING/ForkPoolWorker-3] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2235
[2022-06-15 10:36:35,846: WARNING/ForkPoolWorker-5] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2237
[2022-06-15 10:36:36,008: WARNING/ForkPoolWorker-9] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2241
[2022-06-15 10:36:36,162: WARNING/ForkPoolWorker-15] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2247
[2022-06-15 10:36:36,314: WARNING/ForkPoolWorker-4] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2236
[2022-06-15 10:36:36,500: WARNING/ForkPoolWorker-11] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2243
[2022-06-15 10:36:36,640: WARNING/ForkPoolWorker-7] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2239
[2022-06-15 10:36:36,830: WARNING/ForkPoolWorker-2] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2234
[2022-06-15 10:36:38,787: WARNING/ForkPoolWorker-12] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2244
[2022-06-15 10:36:38,967: WARNING/ForkPoolWorker-14] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2246
[2022-06-15 10:36:39,133: WARNING/ForkPoolWorker-16] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2248
[2022-06-15 10:36:39,286: WARNING/ForkPoolWorker-17] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2249
[2022-06-15 10:36:39,445: WARNING/ForkPoolWorker-18] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2250
[2022-06-15 10:36:39,606: WARNING/ForkPoolWorker-19] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2251
[2022-06-15 10:36:39,751: WARNING/ForkPoolWorker-20] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2252
[2022-06-15 10:36:39,907: WARNING/ForkPoolWorker-6] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2238
[2022-06-15 10:36:40,041: WARNING/ForkPoolWorker-8] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2240
[2022-06-15 10:36:40,209: WARNING/ForkPoolWorker-10] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2242
[2022-06-15 10:36:40,363: WARNING/ForkPoolWorker-13] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2245
[2022-06-15 10:36:40,532: WARNING/ForkPoolWorker-1] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2233
[2022-06-15 10:36:40,676: WARNING/ForkPoolWorker-3] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2235
[2022-06-15 10:36:40,850: WARNING/ForkPoolWorker-5] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2237
[2022-06-15 10:36:41,013: WARNING/ForkPoolWorker-9] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2241
[2022-06-15 10:36:41,168: WARNING/ForkPoolWorker-15] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2247
[2022-06-15 10:36:41,320: WARNING/ForkPoolWorker-4] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2236
[2022-06-15 10:36:41,501: WARNING/ForkPoolWorker-11] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2243
[2022-06-15 10:36:41,642: WARNING/ForkPoolWorker-7] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2239
[2022-06-15 10:36:41,837: WARNING/ForkPoolWorker-2] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2234
[2022-06-15 10:36:43,793: WARNING/ForkPoolWorker-12] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2244
[2022-06-15 10:36:43,970: WARNING/ForkPoolWorker-14] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2246
[2022-06-15 10:36:44,139: WARNING/ForkPoolWorker-16] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2248
[2022-06-15 10:36:44,293: WARNING/ForkPoolWorker-17] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2249
[2022-06-15 10:36:44,451: WARNING/ForkPoolWorker-18] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2250
[2022-06-15 10:36:44,611: WARNING/ForkPoolWorker-19] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2251
[2022-06-15 10:36:44,757: WARNING/ForkPoolWorker-20] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2252
[2022-06-15 10:36:44,914: WARNING/ForkPoolWorker-6] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2238
[2022-06-15 10:36:45,047: WARNING/ForkPoolWorker-8] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2240
[2022-06-15 10:36:45,213: WARNING/ForkPoolWorker-10] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2242
[2022-06-15 10:36:45,370: WARNING/ForkPoolWorker-13] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2245
[2022-06-15 10:36:45,538: WARNING/ForkPoolWorker-1] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2233
[2022-06-15 10:36:45,682: WARNING/ForkPoolWorker-3] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2235
[2022-06-15 10:36:45,856: WARNING/ForkPoolWorker-5] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2237
[2022-06-15 10:36:46,020: WARNING/ForkPoolWorker-9] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2241
[2022-06-15 10:36:46,174: WARNING/ForkPoolWorker-15] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2247
[2022-06-15 10:36:46,327: WARNING/ForkPoolWorker-4] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2236
[2022-06-15 10:36:46,507: WARNING/ForkPoolWorker-11] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2243
[2022-06-15 10:36:46,644: WARNING/ForkPoolWorker-7] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2239
[2022-06-15 10:36:46,842: WARNING/ForkPoolWorker-2] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2234
[2022-06-15 10:36:48,799: WARNING/ForkPoolWorker-12] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2244
[2022-06-15 10:36:48,800: INFO/ForkPoolWorker-12] Task celerydemo.my_task1[c0f1d2a9-e8f5-4bbe-ab83-342dd0169b06] succeeded in 20.02466685499985s: '程序运行结束'
[2022-06-15 10:36:48,976: WARNING/ForkPoolWorker-14] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2246
[2022-06-15 10:36:48,977: INFO/ForkPoolWorker-14] Task celerydemo.my_task1[32d71964-a54f-4ec6-9e5a-4daba9b06786] succeeded in 20.02047951700024s: '程序运行结束'
[2022-06-15 10:36:49,145: WARNING/ForkPoolWorker-16] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2248
[2022-06-15 10:36:49,146: INFO/ForkPoolWorker-16] Task celerydemo.my_task1[6176a780-1e62-42b5-8f9f-395947466b0d] succeeded in 20.02151628699994s: '程序运行结束'
[2022-06-15 10:36:49,297: WARNING/ForkPoolWorker-17] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2249
[2022-06-15 10:36:49,298: INFO/ForkPoolWorker-17] Task celerydemo.my_task1[5e5309c5-9290-4813-9e8c-d87b67fe0f27] succeeded in 20.023608986s: '程序运行结束'
[2022-06-15 10:36:49,455: WARNING/ForkPoolWorker-18] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2250
[2022-06-15 10:36:49,456: INFO/ForkPoolWorker-18] Task celerydemo.my_task1[5095be3d-9683-4253-80d9-c8f35ea58ec4] succeeded in 20.017838478000158s: '程序运行结束'
[2022-06-15 10:36:49,617: WARNING/ForkPoolWorker-19] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2251
[2022-06-15 10:36:49,618: INFO/ForkPoolWorker-19] Task celerydemo.my_task1[67e35f4d-d4bc-4f7e-b4e9-e15ee39ccd95] succeeded in 20.02021437700023s: '程序运行结束'
[2022-06-15 10:36:49,762: WARNING/ForkPoolWorker-20] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2252
[2022-06-15 10:36:49,763: INFO/ForkPoolWorker-20] Task celerydemo.my_task1[c2cd6685-4983-4c26-b4ad-d89befb72c5c] succeeded in 20.02072098699955s: '程序运行结束'
[2022-06-15 10:36:49,920: WARNING/ForkPoolWorker-6] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2238
[2022-06-15 10:36:49,921: INFO/ForkPoolWorker-6] Task celerydemo.my_task1[0fca31bb-9d59-4a4a-8659-03105c3bcf2a] succeeded in 20.02135350899971s: '程序运行结束'
[2022-06-15 10:36:50,050: WARNING/ForkPoolWorker-8] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2240
[2022-06-15 10:36:50,051: INFO/ForkPoolWorker-8] Task celerydemo.my_task1[bdedaa01-adf0-4df6-a5d0-270250dbd61a] succeeded in 20.018396849000055s: '程序运行结束'
[2022-06-15 10:36:50,214: WARNING/ForkPoolWorker-10] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2242
[2022-06-15 10:36:50,215: INFO/ForkPoolWorker-10] Task celerydemo.my_task1[ce72ad98-4c3b-45e1-803c-a0a3aef69067] succeeded in 20.013037463000728s: '程序运行结束'
[2022-06-15 10:36:50,376: WARNING/ForkPoolWorker-13] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2245
[2022-06-15 10:36:50,376: INFO/ForkPoolWorker-13] Task celerydemo.my_task1[481b249b-528a-4638-984c-c9854a2f9b5c] succeeded in 20.02410665499974s: '程序运行结束'
[2022-06-15 10:36:50,544: WARNING/ForkPoolWorker-1] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2233
[2022-06-15 10:36:50,545: INFO/ForkPoolWorker-1] Task celerydemo.my_task1[7848cab8-aa4e-48aa-8fa8-2554a359a9f8] succeeded in 20.02423155300039s: '程序运行结束'
[2022-06-15 10:36:50,688: WARNING/ForkPoolWorker-3] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2235
[2022-06-15 10:36:50,689: INFO/ForkPoolWorker-3] Task celerydemo.my_task1[cb8299cf-d181-4260-89e2-bf548d0f5407] succeeded in 20.023453496000002s: '程序运行结束'
[2022-06-15 10:36:50,860: WARNING/ForkPoolWorker-5] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2237
[2022-06-15 10:36:50,861: INFO/ForkPoolWorker-5] Task celerydemo.my_task1[a8b81720-2068-483c-9c10-abef1d6ac14e] succeeded in 20.02027526799975s: '程序运行结束'
[2022-06-15 10:36:51,027: WARNING/ForkPoolWorker-9] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2241
[2022-06-15 10:36:51,027: INFO/ForkPoolWorker-9] Task celerydemo.my_task1[0ef0613f-ae65-4e2e-9f37-7d43eab13ef6] succeeded in 20.024970935000056s: '程序运行结束'
[2022-06-15 10:36:51,179: WARNING/ForkPoolWorker-15] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2247
[2022-06-15 10:36:51,180: INFO/ForkPoolWorker-15] Task celerydemo.my_task1[4767c9d9-afcc-4fed-91f5-3aee46fdb272] succeeded in 20.023818045000553s: '程序运行结束'
[2022-06-15 10:36:51,333: WARNING/ForkPoolWorker-4] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2236
[2022-06-15 10:36:51,334: INFO/ForkPoolWorker-4] Task celerydemo.my_task1[dfd52b7a-4f21-4e82-a377-aa703875f996] succeeded in 20.025495054000203s: '程序运行结束'
[2022-06-15 10:36:51,512: WARNING/ForkPoolWorker-11] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2243
[2022-06-15 10:36:51,513: INFO/ForkPoolWorker-11] Task celerydemo.my_task1[200bc617-eef0-4702-a268-6d0b5fd4f174] succeeded in 20.016432588000498s: '程序运行结束'
[2022-06-15 10:36:51,650: WARNING/ForkPoolWorker-7] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2239
[2022-06-15 10:36:51,651: INFO/ForkPoolWorker-7] Task celerydemo.my_task1[af1fc72d-a31a-4de3-9097-05540e7d1b35] succeeded in 20.011006683999767s: '程序运行结束'
[2022-06-15 10:36:51,849: WARNING/ForkPoolWorker-2] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2234
[2022-06-15 10:36:51,850: INFO/ForkPoolWorker-2] Task celerydemo.my_task1[db9a9ac2-913a-4c63-ac97-36f02e90dcdb] succeeded in 20.024562674000663s: '程序运行结束'
[2022-06-15 10:36:53,807: WARNING/ForkPoolWorker-12] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2244
[2022-06-15 10:36:53,980: WARNING/ForkPoolWorker-14] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2246
[2022-06-15 10:36:54,152: WARNING/ForkPoolWorker-16] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2248
[2022-06-15 10:36:54,304: WARNING/ForkPoolWorker-17] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2249
[2022-06-15 10:36:54,463: WARNING/ForkPoolWorker-18] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2250
[2022-06-15 10:36:54,622: WARNING/ForkPoolWorker-19] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2251
[2022-06-15 10:36:54,770: WARNING/ForkPoolWorker-20] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2252
[2022-06-15 10:36:54,927: WARNING/ForkPoolWorker-6] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2238
[2022-06-15 10:36:55,058: WARNING/ForkPoolWorker-8] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2240
[2022-06-15 10:36:55,217: WARNING/ForkPoolWorker-10] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2242
[2022-06-15 10:36:55,383: WARNING/ForkPoolWorker-13] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2245
[2022-06-15 10:36:55,551: WARNING/ForkPoolWorker-1] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2233
[2022-06-15 10:36:55,695: WARNING/ForkPoolWorker-3] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2235
[2022-06-15 10:36:55,868: WARNING/ForkPoolWorker-5] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2237
[2022-06-15 10:36:56,034: WARNING/ForkPoolWorker-9] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2241
[2022-06-15 10:36:56,186: WARNING/ForkPoolWorker-15] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2247
[2022-06-15 10:36:56,341: WARNING/ForkPoolWorker-4] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2236
[2022-06-15 10:36:56,517: WARNING/ForkPoolWorker-11] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2243
[2022-06-15 10:36:56,657: WARNING/ForkPoolWorker-7] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2239
[2022-06-15 10:36:56,856: WARNING/ForkPoolWorker-2] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2234
[2022-06-15 10:36:58,813: WARNING/ForkPoolWorker-12] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2244
[2022-06-15 10:36:58,986: WARNING/ForkPoolWorker-14] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2246
[2022-06-15 10:36:59,157: WARNING/ForkPoolWorker-16] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2248
[2022-06-15 10:36:59,310: WARNING/ForkPoolWorker-17] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2249
[2022-06-15 10:36:59,469: WARNING/ForkPoolWorker-18] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2250
[2022-06-15 10:36:59,627: WARNING/ForkPoolWorker-19] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2251
[2022-06-15 10:36:59,776: WARNING/ForkPoolWorker-20] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2252
[2022-06-15 10:36:59,933: WARNING/ForkPoolWorker-6] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2238
[2022-06-15 10:37:00,063: WARNING/ForkPoolWorker-8] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2240
[2022-06-15 10:37:00,218: WARNING/ForkPoolWorker-10] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2242
[2022-06-15 10:37:00,389: WARNING/ForkPoolWorker-13] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2245
[2022-06-15 10:37:00,558: WARNING/ForkPoolWorker-1] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2233
[2022-06-15 10:37:00,701: WARNING/ForkPoolWorker-3] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2235
[2022-06-15 10:37:00,873: WARNING/ForkPoolWorker-5] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2237
[2022-06-15 10:37:01,040: WARNING/ForkPoolWorker-9] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2241
[2022-06-15 10:37:01,192: WARNING/ForkPoolWorker-15] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2247
[2022-06-15 10:37:01,347: WARNING/ForkPoolWorker-4] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2236
[2022-06-15 10:37:01,523: WARNING/ForkPoolWorker-11] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2243
[2022-06-15 10:37:01,663: WARNING/ForkPoolWorker-7] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2239
[2022-06-15 10:37:01,859: WARNING/ForkPoolWorker-2] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2234
[2022-06-15 10:37:03,820: WARNING/ForkPoolWorker-12] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2244
[2022-06-15 10:37:03,989: WARNING/ForkPoolWorker-14] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2246
[2022-06-15 10:37:04,164: WARNING/ForkPoolWorker-16] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2248
[2022-06-15 10:37:04,316: WARNING/ForkPoolWorker-17] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2249
[2022-06-15 10:37:04,475: WARNING/ForkPoolWorker-18] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2250
[2022-06-15 10:37:04,634: WARNING/ForkPoolWorker-19] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2251
[2022-06-15 10:37:04,777: WARNING/ForkPoolWorker-20] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2252
[2022-06-15 10:37:04,940: WARNING/ForkPoolWorker-6] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2238
[2022-06-15 10:37:05,070: WARNING/ForkPoolWorker-8] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2240
[2022-06-15 10:37:05,221: WARNING/ForkPoolWorker-10] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2242
[2022-06-15 10:37:05,395: WARNING/ForkPoolWorker-13] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2245
[2022-06-15 10:37:05,564: WARNING/ForkPoolWorker-1] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2233
[2022-06-15 10:37:05,707: WARNING/ForkPoolWorker-3] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2235
[2022-06-15 10:37:05,877: WARNING/ForkPoolWorker-5] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2237
[2022-06-15 10:37:06,045: WARNING/ForkPoolWorker-9] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2241
[2022-06-15 10:37:06,198: WARNING/ForkPoolWorker-15] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2247
[2022-06-15 10:37:06,351: WARNING/ForkPoolWorker-4] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2236
[2022-06-15 10:37:06,528: WARNING/ForkPoolWorker-11] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2243
[2022-06-15 10:37:06,669: WARNING/ForkPoolWorker-7] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2239
[2022-06-15 10:37:06,865: WARNING/ForkPoolWorker-2] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2234
[2022-06-15 10:37:08,826: WARNING/ForkPoolWorker-12] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2244
[2022-06-15 10:37:08,827: INFO/ForkPoolWorker-12] Task celerydemo.my_task1[b8a14575-a691-48d7-9cb5-da16c9fcfce6] succeeded in 20.025668475999737s: '程序运行结束'
[2022-06-15 10:37:08,995: WARNING/ForkPoolWorker-14] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2246
[2022-06-15 10:37:08,995: INFO/ForkPoolWorker-14] Task celerydemo.my_task1[c4c52ae8-2238-4f97-bb21-027046244649] succeeded in 20.017487228999926s: '程序运行结束'
[2022-06-15 10:37:09,167: WARNING/ForkPoolWorker-16] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2248
[2022-06-15 10:37:09,168: INFO/ForkPoolWorker-16] Task celerydemo.my_task1[707eaa09-22f8-4798-b309-f51163602a7d] succeeded in 20.02072815700012s: '程序运行结束'
[2022-06-15 10:37:09,319: WARNING/ForkPoolWorker-17] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2249
[2022-06-15 10:37:09,320: INFO/ForkPoolWorker-17] Task celerydemo.my_task1[aa273077-a41d-4d5b-8499-c74d1b1c5ded] succeeded in 20.020615946999897s: '程序运行结束'
[2022-06-15 10:37:09,479: WARNING/ForkPoolWorker-18] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2250
[2022-06-15 10:37:09,480: INFO/ForkPoolWorker-18] Task celerydemo.my_task1[7fce65d3-e27e-4638-8365-79efd0d33941] succeeded in 20.022807616000136s: '程序运行结束'
[2022-06-15 10:37:09,639: WARNING/ForkPoolWorker-19] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2251
[2022-06-15 10:37:09,640: INFO/ForkPoolWorker-19] Task celerydemo.my_task1[2a140765-b885-4327-a625-277f7f8b39ea] succeeded in 20.020627856999454s: '程序运行结束'
[2022-06-15 10:37:09,779: WARNING/ForkPoolWorker-20] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2252
[2022-06-15 10:37:09,780: INFO/ForkPoolWorker-20] Task celerydemo.my_task1[6f3177c1-e418-46de-bfda-aff68c89d1ba] succeeded in 20.015455879999536s: '程序运行结束'
[2022-06-15 10:37:09,946: WARNING/ForkPoolWorker-6] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2238
[2022-06-15 10:37:09,946: INFO/ForkPoolWorker-6] Task celerydemo.my_task1[64876ebf-2a41-4c45-b222-307fe6362531] succeeded in 20.024087052999676s: '程序运行结束'
[2022-06-15 10:37:10,071: WARNING/ForkPoolWorker-8] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2240
[2022-06-15 10:37:10,072: INFO/ForkPoolWorker-8] Task celerydemo.my_task1[e65911f2-eab0-4e46-bd29-9f37ace22419] succeeded in 20.019587164999393s: '程序运行结束'
[2022-06-15 10:37:10,222: WARNING/ForkPoolWorker-10] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2242
[2022-06-15 10:37:10,222: INFO/ForkPoolWorker-10] Task celerydemo.my_task1[1ac966c7-538f-4236-8e88-e8e6a009e0e0] succeeded in 20.00618862400006s: '程序运行结束'
[2022-06-15 10:37:10,402: WARNING/ForkPoolWorker-13] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2245
[2022-06-15 10:37:10,403: INFO/ForkPoolWorker-13] Task celerydemo.my_task1[6fb90d3b-2c79-4281-b1d0-7f588548958f] succeeded in 20.02497601699997s: '程序运行结束'
[2022-06-15 10:37:10,571: WARNING/ForkPoolWorker-1] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2233
[2022-06-15 10:37:10,572: INFO/ForkPoolWorker-1] Task celerydemo.my_task1[da0cde1f-992b-4d08-a350-b4ce5dbf8a5b] succeeded in 20.0257986430006s: '程序运行结束'
[2022-06-15 10:37:10,713: WARNING/ForkPoolWorker-3] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2235
[2022-06-15 10:37:10,714: INFO/ForkPoolWorker-3] Task celerydemo.my_task1[28cd1e43-d098-4e27-926b-1b4648da907c] succeeded in 20.023876684999777s: '程序运行结束'
[2022-06-15 10:37:10,879: WARNING/ForkPoolWorker-5] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2237
[2022-06-15 10:37:10,880: INFO/ForkPoolWorker-5] Task celerydemo.my_task1[6ace3530-e206-4cb7-9892-876aff0843a2] succeeded in 20.017150429999674s: '程序运行结束'
[2022-06-15 10:37:11,046: WARNING/ForkPoolWorker-9] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2241
[2022-06-15 10:37:11,047: INFO/ForkPoolWorker-9] Task celerydemo.my_task1[0b2a9070-cde9-4e5e-aa69-b15bb15b3170] succeeded in 20.018048507999993s: '程序运行结束'
[2022-06-15 10:37:11,205: WARNING/ForkPoolWorker-15] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2247
[2022-06-15 10:37:11,205: INFO/ForkPoolWorker-15] Task celerydemo.my_task1[f975d495-9895-472f-b222-8ea72ac13215] succeeded in 20.0242805150001s: '程序运行结束'
[2022-06-15 10:37:11,357: WARNING/ForkPoolWorker-4] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2236
[2022-06-15 10:37:11,358: INFO/ForkPoolWorker-4] Task celerydemo.my_task1[82ee3af1-72c8-451a-91c4-7ea0bd360309] succeeded in 20.021968756000206s: '程序运行结束'
[2022-06-15 10:37:11,529: WARNING/ForkPoolWorker-11] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2243
[2022-06-15 10:37:11,530: INFO/ForkPoolWorker-11] Task celerydemo.my_task1[ceeb4ad0-5c08-4a1b-9af0-7d3344c6ce6e] succeeded in 20.015602989999934s: '程序运行结束'
[2022-06-15 10:37:11,676: WARNING/ForkPoolWorker-7] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2239
[2022-06-15 10:37:11,678: INFO/ForkPoolWorker-7] Task celerydemo.my_task1[76b90ae2-6d73-47d3-8e3d-1e2529c7801b] succeeded in 20.02558762499939s: '程序运行结束'
[2022-06-15 10:37:11,871: WARNING/ForkPoolWorker-2] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2234
[2022-06-15 10:37:11,872: INFO/ForkPoolWorker-2] Task celerydemo.my_task1[0a219d12-e925-4495-92d2-dcd7c39dd431] succeeded in 20.021550999999818s: '程序运行结束'
[2022-06-15 10:37:13,831: WARNING/ForkPoolWorker-12] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2244
[2022-06-15 10:37:14,002: WARNING/ForkPoolWorker-14] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2246
[2022-06-15 10:37:14,174: WARNING/ForkPoolWorker-16] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2248
[2022-06-15 10:37:18,836: WARNING/ForkPoolWorker-12] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2244
[2022-06-15 10:37:19,007: WARNING/ForkPoolWorker-14] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2246
[2022-06-15 10:37:19,181: WARNING/ForkPoolWorker-16] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2248
[2022-06-15 10:37:23,842: WARNING/ForkPoolWorker-12] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2244
[2022-06-15 10:37:24,013: WARNING/ForkPoolWorker-14] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2246
[2022-06-15 10:37:24,185: WARNING/ForkPoolWorker-16] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2248
[2022-06-15 10:37:28,849: WARNING/ForkPoolWorker-12] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2244
[2022-06-15 10:37:28,849: INFO/ForkPoolWorker-12] Task celerydemo.my_task1[0320156e-d05c-4993-81e9-81e6654ff386] succeeded in 20.02115291500013s: '程序运行结束'
[2022-06-15 10:37:29,019: WARNING/ForkPoolWorker-14] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2246
[2022-06-15 10:37:29,020: INFO/ForkPoolWorker-14] Task celerydemo.my_task1[31398250-4b60-42b6-acf8-bbe4d507b6c5] succeeded in 20.023061996999786s: '程序运行结束'
[2022-06-15 10:37:29,191: WARNING/ForkPoolWorker-16] 刚才睡了5秒钟,运行线程名称:MainThread,运行线程ID:140660677379904,进程ID:2248
[2022-06-15 10:37:29,191: INFO/ForkPoolWorker-16] Task celerydemo.my_task1[6d9baed7-1c74-44f0-b86d-3154f885a010] succeeded in 20.022218135999537s: '程序运行结束'

可以看出来的确20个进程在处理,速度很快,满足了我们预期效果。
如果服务器核数读的话,默认使用自己的cpu核数进程处理即可,通过top命令其实服务器的压力也不是很大,一般的定时任务处理出题不大,我现在使用的hpunix Oracle数据库服务器64个逻辑CPU,2200个进程都可以同时开启问题不大

Flask celery消息生成消费相关推荐

  1. 面试官:给我一个避免消息重复消费的解决方案?

    欢迎关注方志朋的博客,回复"666"获面试宝典 消息中间件是分布式系统常用的组件,无论是异步化.解耦.削峰等都有广泛的应用价值. 我们通常会认为,消息中间件是一个可靠的组件--这里 ...

  2. RabbitMQ消息重复消费问题

    业务背景 消息队列在数据传输的过程中,为了保证消息传递的可靠性,一般会对消息采用ack确认机制,如果消息传递失败,消息队列会进行重试,此时便可能存在消息重复消费的问题. 比如,用户到银行取钱后会收到扣 ...

  3. Spring Cloud Stream如何处理消息重复消费

    最近收到好几个类似的问题:使用Spring Cloud Stream操作RabbitMQ或Kafka的时候,出现消息重复消费的问题.通过沟通与排查下来主要还是用户对消费组的认识不够.其实,在之前的博文 ...

  4. kafka 脚本发送_Kafka笔记归纳(第五部分:一致性保证,消息重复消费场景及解决方式)...

    写在开头: 本章是Kafka学习归纳第五部分,着重于强调Kafka的事一致性保证,消息重复消费场景及解决方式,记录偏移量的主题,延时队列的知识点. 文章内容输出来源:拉勾教育大数据高薪训练营. 一致性 ...

  5. rocketmq 消息指定_SpringBoot 整合 RocketMQ 如何实现消息生产消费?

    有时候我们在使用消息队列的时候,往往需要能够保证消息的顺序消费,而RocketMQ是可以支持消息的顺序消费的. RocketMQ在发送消息的时候,是将消息发送到不同的队列中,然后消费端从多个队列中读取 ...

  6. RocketMQ如何保证消息顺序消费?又为何不解决消息重复消费问题?

    消息的顺序消费对于业务系统来说非常重要,一笔订单产生了3条消息,分别是订单创建.订单付款.订单完成.消费时,必须按照顺序消费才有意义,与此同时多笔订单之间又是可以并行消费的. 如何保证消息顺序消费? ...

  7. 第四十六章:SpringBoot RabbitMQ完成消息延迟消费

    在2018-3-1日SpringBoot官方发版了2.0.0.RELEASE最新版本,新版本完全基于Spring5.0来构建,JDK最低支持也从原来的1.6也改成了1.8,不再兼容1.8以下的版本,更 ...

  8. RocketMQ(七)——消息的消费

    文章目录 消息的消费 消费的类型 Pull方式 缺点: 优点: Push方式 缺点 优点: 消费的模式 广播消费 集群消费 消费进度的保存 消息的消费 消费的类型 消费者从Broker中获取消息的方式 ...

  9. 【重难点】【RabbitMQ 02】如何避免消息重复投递和消息重复消费、如何防止消息丢失、如何保证消息的顺序性、如何保证消息队列的可用性

    [重难点][RabbitMQ 02]如何避免消息重复投递和消息重复消费.如何防止消息丢失.如何保证消息的顺序性.如何保证消息队列的可用性 文章目录 [重难点][RabbitMQ 02]如何避免消息重复 ...

最新文章

  1. struts2和spring的两种整合方式 action的自动装配
  2. 如何卸载Windows 7中的IE10并还原到IE9
  3. 大学生有必要学python吗_大学生学python到底有没有用?
  4. 【Python面试】 说说Python面向对象三大特性?
  5. 元类及创建元类的方法(面试用
  6. snmpwalk命令常用方法
  7. 线段树区改区查标记永久化板子
  8. 2021年本溪高中高考成绩查询入口,2021年本溪中考录取结果查询,什么时候出来附查询网址入口...
  9. UG NX 12 重复命令
  10. 电脑丢失dll文件能一键修复吗,哪种修复方法靠谱?
  11. STM32F107+LWIP+FreeRTOS
  12. java安卓软件开发_9大安卓app开发软件盘点,0基础自己也能开发开发安卓app
  13. 【Win 10】学生必备!删除鼠标右键多余的“新建”选项
  14. 【leetcode】714. 买卖股票的最佳时机含手续费
  15. python中重采样的时间间隔与等距,resample,periods
  16. 逆向教程2 某信营业厅
  17. 区块链笔记-(肖臻)(二刷自用笔记)-----三
  18. 70行代码撸一个桌面自动翻译神器!
  19. 光猫显示连接isp服务器超时,光猫链接isp服务器超时
  20. 2021-07-24java学习

热门文章

  1. 2018教师评职称要可计算机吗,好消息!2018年教师职称评审:这几个变化,你了解了吗?...
  2. SpringMVC基于ResponseEntity的文件下载
  3. 世界上最伟大最邪恶的软件发明,已有超10亿台电脑安装
  4. 数据库事务与事务回滚
  5. 边缘计算的崛起:推动大流行后经济复苏的关键力量
  6. Kubernetes Multus-CNI
  7. 2020网易雷火游戏客户端开发实习生面试题
  8. 面试屡屡碰壁,痛定思痛闭关修炼!半年后4面阿里成功拿offer
  9. Backtrader量化回测11——策略信号Indicator
  10. MATLAB批量为png透明(抠图)图片替换添加背景