I’m building a backend system using PyAMF for a Flash application that needs to serve large batches of photos to users based on their requests. During development, I used PyAMF’s built-in development server, but now I need to create a production-ready solution.
My application needs to fetch images from a MySQL database and deliver them quickly to multiple users at the same time. I want the best performance possible since there will be many concurrent connections.
I’m getting overwhelmed by all the server options available. Should I go with Tornado, Twisted, or maybe web2py? What about WSGI servers versus socket-based servers? I’m also wondering if Apache modules like mod_wsgi would be better.
Can someone explain the main differences between these approaches? I’m looking for guidance on which option would work best for high-performance image delivery with PyAMF.
what’s ur concurrent load like? 50 users or thousands? are u storing image blobs directly in mysql or just file paths? if it’s blobs, that’ll bottleneck regardless of ur server choice. ever think about using nginx for static files?
twisted’s probably your best bet, but dont overlook gevent with a basic wsgi setup. i’ve watched it handle insane image loads really well, and it’s much easier to debug than twisted’s callback nightmare. just patch ur mysql driver right or u’ll hit blocking issues that destroy performance.
Go with Twisted for PyAMF image delivery when you need high concurrency. I’ve deployed similar systems and Twisted just works better here - PyAMF was built with Twisted’s async architecture from the start. The event-driven model crushes it when handling tons of simultaneous image requests without blocking threads. This matters big time when you’re pulling large photo batches from MySQL since database queries won’t freeze other connections. Skip WSGI and socket-based servers for this. PyAMF needs persistent connections and binary data handling that WSGI wasn’t built for. Apache with mod_wsgi works fine for regular web apps but adds pointless overhead for AMF communication. Here’s what most people miss: throw a caching layer between your app and MySQL. Even the best server setup won’t save you if your database becomes the bottleneck. Redis or memcached for frequently accessed images will make a huge difference. Tornado’s an option but you’ll fight with AMF configuration. Twisted gives you native support for what your Flash app expects right out of the box.