- 
      
 - 
        
Save tOlorun/2b5bf2a442a211b5d50a1a512fe49b1c to your computer and use it in GitHub Desktop.  
Revisions
- 
        
amatellanes revised this gist
Nov 1, 2014 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -56,8 +56,6 @@ i.active() // Get a list of active tasks i.scheduled // Get a list of tasks waiting to be scheduled i.reserved() # Get a list of tasks that has been received, but are still waiting to be executed app.control.broadcast('shutdown') # shutdown all workers app.control.broadcast('shutdown', destination=['celer@worker'])  - 
        
amatellanes revised this gist
Oct 21, 2014 . 1 changed file with 15 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -34,12 +34,20 @@ celery multi start w1 -A proj -l info --pidfile=/var/run/celery/%n.pid --logfile celery -A proj inspect active # control and inspect workers at runtime celery -A proj inspect active [email protected] celery -A proj inspect scheduled # list scheduled ETA tasks. celery -A proj control cancel_consumer # Force all worker to cancel consuming from a queue celery -A proj control cancel_consumer foo -d worker1.local # Force an specified worker to cancel consuming from a queue celery -A proj inspect active_queues # Get a list of queues that workers consume celery -A proj inspect active_queues -d celery@worker1 # Get a list of queues that a worker consumes celery -A proj inspect stats # show worker statistics. celery shell -I # Drop into IPython console. celery -A tasks result -t tasks.add dbc53a54-bd97-4d72-908c-937827009736 # See the result of a task. # Control workers i = app.control.inspect() i = app.control.inspect(['worker1.example.com', 'worker2.example.com']) @@ -54,4 +62,8 @@ app.control.broadcast('shutdown') # shutdown all workers app.control.broadcast('shutdown', destination=['celer@worker']) app.control.ping() app.control.ping(['celer@worker']) # Inspecting queues in Redis redis-cli -h HOST -p PORT -n DATABASE_NUMBER llen QUEUE_NAME LRANGE queue_name 0 10 # Redis client  - 
        
amatellanes revised this gist
Sep 28, 2014 . 1 changed file with 7 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -48,4 +48,10 @@ i.active() // Get a list of active tasks i.scheduled // Get a list of tasks waiting to be scheduled i.reserved() # Get a list of tasks that has been received, but are still waiting to be executed celery -A tasks inspect stats # Show statistic about workers app.control.broadcast('shutdown') # shutdown all workers app.control.broadcast('shutdown', destination=['celer@worker']) app.control.ping() app.control.ping(['celer@worker'])  - 
        
amatellanes revised this gist
Sep 26, 2014 . 1 changed file with 17 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -32,4 +32,20 @@ celery multi stopwait w1 -A proj -l info # stop after executing tasks are compl celery multi start w1 -A proj -l info --pidfile=/var/run/celery/%n.pid --logfile=/var/log/celery/%n%I.log # create pid and log files in the current directory celery -A proj inspect active # control and inspect workers at runtime celery -A proj inspect active [email protected] celery -A tasks control cancel_consumer # Force all worker to cancel consuming from a queue celery -A tasks control cancel_consumer foo -d worker1.local # Force an specified worker to cancel consuming from a queue celery -A proj inspect active_queues # Get a list of queues that workers consume celery -A proj inspect active_queues -d celery@worker1 # Get a list of queues that a worker consumes # Control workers i = app.control.inspect() i = app.control.inspect(['worker1.example.com', 'worker2.example.com']) i.registered() // Show registred tasks for specified workers i.active() // Get a list of active tasks i.scheduled // Get a list of tasks waiting to be scheduled i.reserved() # Get a list of tasks that has been received, but are still waiting to be executed celery -A tasks inspect stats # Show statistic about workers  - 
        
amatellanes revised this gist
Sep 11, 2014 . 1 changed file with 19 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,22 @@ /* Useful celery config. app = Celery('tasks', broker='redis://localhost:6379', backend='redis://localhost:6379') app.conf.update( CELERY_TASK_RESULT_EXPIRES=3600, CELERY_QUEUES=( Queue('default', routing_key='tasks.#'), Queue('hipri', routing_key='tasks.#'), ), CELERY_ROUTES={ 'tasks.tasks.add': {'queue': 'hipri'}, } ) */ celery -A tasks worker --loglevel=info # run the worker celery worker --help # list command-line options available  - 
        
amatellanes revised this gist
Sep 8, 2014 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,4 +10,7 @@ celery multi stop w1 -A proj -l info # stop workers aynchronously celery multi stopwait w1 -A proj -l info # stop after executing tasks are completed celery multi start w1 -A proj -l info --pidfile=/var/run/celery/%n.pid --logfile=/var/log/celery/%n%I.log # create pid and log files in the current directory celery -A proj inspect active # control and inspect workers at runtime celery -A proj inspect active [email protected]  - 
        
amatellanes revised this gist
Sep 6, 2014 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,4 +6,8 @@ celery multi start w1 -A proj -l info # start one or more workers in the backgr celery multi restart w1 -A proj -l info # restart workers celery multi stop w1 -A proj -l info # stop workers aynchronously celery multi stopwait w1 -A proj -l info # stop after executing tasks are completed celery multi start w1 -A proj -l info --pidfile=/var/run/celery/%n.pid --logfile=/var/log/celery/%n%I.log # create pid and log files in the current directory  - 
        
amatellanes created this gist
Sep 6, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ celery -A tasks worker --loglevel=info # run the worker celery worker --help # list command-line options available celery multi start w1 -A proj -l info # start one or more workers in the background celery multi restart w1 -A proj -l info # restart workers celery multi stop w1 -A proj -l info # stop workers