I am using the gevent loop in uWSGI and I write to a redis queue. I get about 3.5 qps. On occasion, there will be an issue with the redis connection so….if fail, then write to a file where I will have a separate process do cleanup later. Because my app very latency aware, what is the fastest way to dump to disk in python? Will python logging suffice?
Share
If latency is a crucial factor for your app, undefinitely writing to disk could make things really bad.
If you want to survive a reboot of your server while redis is still down i see no other solutions than writing to disk, otherwise you may want to try with a ramdisk.
Are you sure having a second server with a second instance of redis would not be a better choice ?
Regarding logging, i would simply use low-level I/O functions as they have less overhead (even if we are talking of very few machine cycles)