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?

Andomar
  • 232,371
  • 49
  • 380
  • 404

1 Answers1

1

you can use celery / redis task queue.

forvaidya
  • 3,041
  • 3
  • 26
  • 33