I found print task.info will display the worker'hostname and pid,but I not found any doc in celery documents. Could I modify the info method to gather other data such as worker time,worker memroy,worker cpu load?
No. You can't add any data to that info dictionary. It only stores task status, task_id and some other internal metadata of celery, unless you set task_track_started = True
.
This information is stored on the result backend by celery, once the worker starts executing the task. You have to use some other monitoring solutions to get the worker memory and cpu load.