Graham Dumpleton

@grahamdumpleton
80 Followers
48 Following
259 Posts
Aficionado in all things #kubernetes and containers. Long time #python user and author of the Apache/mod_wsgi and wrapt projects for Python.
GitHubhttps://github.com/GrahamDumpleton
Bloghttps://grahamdumpleton.me/
Claude also pegged the CPython test suite as only the second thing to heavily exercise sub-interpreters in Python. So mod_wsgi wins. 🥳
Well that was strange and has never happened to me before. Was asking Claude questions about Python sub-interpreters and it came back as saying Apache/mod_wsgi was heaviest user of sub-interpreters. I jokingly responded by saying "I wrote mod_wsgi". It then proceeded to ask me lots of questions about how various aspects of the internals of mod_wsgi worked and how things might change with free threading and per interpreter GIL (which I had not mentioned). If only it could learn and remember.
Hey #pyconus, has there been much talk about Python free threading and per interpreter GIL support. I have added support for both in my mod_wsgi module for hosting Python WSGI applications under Apache/httpd. I am interested in connecting with anyone who may want to explore how these features can be used with WSGI applications in a production grade WSGI server setting. Or are these features still not seen as ready for prime time?
Wow. Data from the incremental GC used in Python 3.13-3.14.4 looks so different.
First pass at trying to collect some real time stats on Python garbage collector behaviour. This is from a Flask web application hosted in mod_wsgi. Using Python 3.14.5 here, but now to see if I can trigger again the memory growth issue when using Python 3.14.4.
Going to update to Python 3.14.5 in mean time since that also has the old GC.
Been running this stuff under load tests for long periods and this is the first time have seen memory usage jump up like this. Makes no sense.
So was one of the pathological cases of the new GC in Python (the one being replaced with old one again in 3.15) is that it could so get its knickers in a knot that it would let a process ramp up to a very high memory usage and then decide to never reclaim it. Load balancing between two web processes with hello world. Both start at about 25MB. Strangely would often see them drop down to 15MB. This time one went up to about 250MB instead and stayed there. About to add some telemetry for GC.
Now have it working such that with one Apache/mod_wsgi instance, you can partition up things so that for any groups of processes, embedded, or daemon process groups, you can selectively say whether they run with free threading, or the GIL. Further, for those processes running with the GIL, you can opt specific sub interpreters into using their own GIL. So full flexibility to dice and slice it how you want. Still open question as to how to best make use of it, but you will have the option.
If it is one build eventually, can still support free threading by default by having a linked binary in same bin directory but where binary name has t suffix on end.