ANN: Long overdue mod_wsgi 4.8.0 release.

15 views
Skip to first unread message

Graham Dumpleton

unread,
May 14, 2021, 12:12:42 AMMay 14
to mod...@googlegroups.com
I finally got off my butt and have made a new mod_wsgi release. Version 4.8.0.

Details in:


Highlights are it is faster and shinier.

Seriously, it is faster.

Or to put it another way I was able to tune out some of the overhead around Python global interpreter locking and so for certain classes of applications you may see lower overheads and potential for greater throughput. This isn't going to apply to all applications because I/O bound applications aren't going to benefit as much, and overly CPU bound applications just overload the whole system anyway.

In addition to that, have made some tweaks to how some of the daemon mode options work and when a specific combination of options are used (with loss of those features though), you can reduce those overheads and increase throughput even more.

But wait, there is more. If you really want to show off and don't need the reliability protections that daemon mode is providing when using the mod_wsgi-express default configuration, then you can now with mod_wsgi-express switch to embedded mode. This can be used to dramatically increase potential throughput, but does mean your application needs to be very robust and not prone to hanging or other things which daemon mode can automatically help recover from when set up correctly as mod_wsgi-express does out of the box.

If want to try and compare performance with some WSGI test program, try with the following variations.

Nothing special, only changing number of threads used by the daemon process from default of 5 to 3, as lower number of threads as possible is always better if you are going to try and hammer the web server with requests.

    mod_wsgi-express start-server --threads=3 wsgi.py

Disable automatic reloading when WSGI script file is modified, and disable queue timeout as well, to eliminate handshake between Apache child worker processes and daemon process before sending request through.

    mod_wsgi-express start-server --threads=3 --disable-reloading --queue-timeout=0 wsgi.py

Switch to embedded mode to eliminate all that overhead of proxying through to the daemon mode processes.

    mod_wsgi-express start-server --threads=3 --embedded-mode wsgi.py

The performance improvements came about as a result of looking carefully at a new bunch of statistics one can get out of mod_wsgi on performance. I'll try and do a followup email on those new APIs later once I can get my test setup going again and I can capture some pretty pictures.

Note, always remember that trying to benchmark stuff on macOS is a really bad idea and gives inconsistent results, so use a Linux system instead.

Graham


Graham Dumpleton

unread,
May 14, 2021, 12:28:57 AMMay 14
to mod...@googlegroups.com
A pretty picture as promised of the sort of metrics you can get out of this new mod_wsgi version without too much effort.


In this case the change in throughput part way was a result of a switch from:

    mod_wsgi-express start-server wsgi.py --disable-reloading --queue-timeout=0

to:

    mod_wsgi-express start-server wsgi.py --processes=1 --threads=1 --embedded-mode

If you have a serious interest in collecting metrics let me know and I can provide more details.

Graham

Jian Wu

unread,
May 14, 2021, 12:58:43 AMMay 14
to mod...@googlegroups.com

Dear Graham,

First of all thanks for such a great work and the invaluable support. I definitely is very interested in being able to get the metrics from my webpage using mod_wsgi. Is there any documentation on this aspects?

Thanks!

Best regards,
Jian

Den 14. maj 2021 kl. 06.28 skrev Graham Dumpleton <graham.d...@gmail.com>:

A pretty picture as promised of the sort of metrics you can get out of this new mod_wsgi version without too much effort.

<PastedGraphic-1.png>

-- 
You received this message because you are subscribed to the Google Groups "modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to modwsgi+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/modwsgi/8AB25786-9F78-466F-8CA7-C64D11D71FE6%40gmail.com.

Jian Wu

unread,
Jul 26, 2021, 1:58:05 PMJul 26
to mod...@googlegroups.com
Dear all,

I am very inexperienced with website hosting and I hope that you can help me out with this issue. I have my website hosted running Ubuntu 20.04 LTS. The backend of my website is running on Django together with modwsgi. 

Today it is first time that I decided to do a large update on my website. I therefore changed the DNS to another server hosting a static page telling the visitors that my main website was under update.

Thereafter I changed my the my hosts file on in my MAC computer where I added these two lines at the bottom of my /etc/hosts file

139.162.163.35 dimsum.dk
139.162.163.35 www.dimsum.dk

Here 139.162.163.35 is the server IP address to the server hosting my website for which I need to update. I haven’t yet updated the website, but at this point I wanted to make sure that I can still access the old website. When I from the browser typed www.dimsum.dk I was lead to a Apache2 Ubuntu Default Page and it says It works!

I don’t know how to access my actual website. Also I am not sure what it meant by “you should replace this file located at /var/www/html/index.html” before continuing to operate your HTTP server”.

Thanks!

Best regards,
Jian

Graham Dumpleton

unread,
Jul 26, 2021, 8:07:39 PMJul 26
to mod...@googlegroups.com
Apache is generally set up to use name based virtual hosting. It is therefore important that you access the site using the hostname the VirtualHost in Apache is configured to use. If you don't then Apache will fallback to using whatever is the first VirtualHost in the Apache configuration which often would be the default pages for the Linux distribution.

Rather than a web browser (in case it is doing DNS/IP caching), you would be better to test with:

    curl -L -H Host:www.dimsum.uk https://139.162.163.35

or "http" if not a secure site.

Graham

<Skærmbillede 2021-07-26 kl. 19.53.50.png>

--
You received this message because you are subscribed to the Google Groups "modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to modwsgi+u...@googlegroups.com.

Jian Wu

unread,
Jul 27, 2021, 1:34:13 AMJul 27
to mod...@googlegroups.com
Thanks Graham.After I sent the email yesterday when I attempted again to visit the www.dimsuum.dk from the browser I could access the site all right. Also when I try to reach the site using curl -L -H Host:www.dimsum.dk http://139.162.163.35 I can reach the site from the terminal as well. 

Thanks!

Jian

Reply all
Reply to author
Forward
0 new messages