0

We're running a Linux server running Apache2 with mod_python. One mod_python script inserts an entry in a database logging table. The logging table is large can be a point of disk-write contention, or it can be temporarily unavailable during database maintenance. We would like to spin off the logging as an asynchronous background task, so that the user request can complete before the logging is done.

Ideally there would be a single background process. The web handler would pass its log request to the background process. The background process would write log entries to the database. The background process would queue up to a hundred requests and drop requests when its queue is full.

Which techniques are available in Python to facilitate communicating with a background process?

1 Answer 1

1

you can use celery / redis task queue.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks. It looks like redis is a key-value store? How would you use that as a queue?
please refer to celeryproject.org. I have successfully used this in my projects.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.