DEV Community

Discussion on: Getting ready for production (Apache + uWSGI + Mojo)

Collapse
 
grinnz profile image
Dan Book • Edited

If you're writing a Mojolicious app it's important to keep in mind that PSGI does not support async request dispatch features (including anything using Promises) or websockets, you must deploy using one of Mojolicious's built-in application servers (like Hypnotoad) for these features, which in many cases can be far more beneficial than other kinds of optimization.

Collapse
 
raigaurav profile image
Gaurav Rai • Edited

Thanks, I was unware of PSGI not supporting thoseπŸ˜ƒ. Even though uWSGI support websockets and async there is no point using it then. In that case normal HTTP to hypnotoad will be better. Also Nginx would be a better choice than Apache in terms of performance.
I just saw the psgi-spec but not able to finding anything related to support of those, so not sure whether it is in scope or not.

Collapse
 
grinnz profile image
Dan Book

There have been attempts to write PSGI extensions to support async but it is not widely used. The Twiggy server supports it but only for the AnyEvent loop which I would not recommend, and Mojolicious doesn't recognize this extension anyway.