Skip to content

Instantly share code, notes, and snippets.

@Quard
Quard / primary_celery_example.py
Last active Dec 15, 2021
The Python Celery Cookbook: Small Tool, Big Possibilities
View primary_celery_example.py
from django.conf import settings
from django.core.mail import send_mail
from django.template import Engine, Context
from myproject.celery import app
def render_template(template, context):
engine = Engine.get_default()
@Quard
Quard / primary_celery_example_use.py
Created Apr 10, 2019
The Python Celery Cookbook: Small Tool, Big Possibilities
View primary_celery_example_use.py
send_mail_task.delay(('noreply@example.com', ), 'Celery cookbook test', 'test', {})
@Quard
Quard / queues_config_example.py
Created Apr 10, 2019
The Python Celery Cookbook: Small Tool, Big Possibilities
View queues_config_example.py
CELERY_TASK_ROUTES = {
'myproject.apps.mail.tasks.send_mail_task': {'queue': 'mail', },
}
@Quard
Quard / run_queues_example.sh
Created Apr 10, 2019
The Python Celery Cookbook: Small Tool, Big Possibilities
View run_queues_example.sh
celery -A myproject worker -l info -Q celery
celery -A myproject worker -l info -Q mail
@Quard
Quard / bechmark_results.md
Created Jul 16, 2019
Benchmark results for article "My story about Go, Python and benkmarks."
View bechmark_results.md

Python + Redis

API get

Running 30s test @ http://rpi:5000/api/v1/url/aaaa
  12 threads and 400 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   489.29ms  196.29ms   1.38s    82.02%
    Req/Sec    68.43     31.64   192.00     72.98%