You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just importing many of these libraries has memory overhead that is large enough to cause problems in production especially in memory-constrained environments such as F1 instances.
Appengine customers are being directed to use these libraries for everything, including simply for getting app logs that are correlated per request (even though it's almost as easy to do this without using the python-logging library at all). Ideally this would be fine, but unfortunately the libraries are not designed in a way that allows selective or lazy imports, if you import one thing you bring in most of the library. If this increased memory overhead causes your instances to be killed, you might then need to increase the instance size and consequently your application's operating costs.
The discovery-based API client is being neglected on purpose, with long-standing bugs remaining unfixed, presumably to encourage everyone to use these libraries instead. We would like to use them, but we can't because they use too much memory.
I didn't intend this issue to be specifically about lazy imports, that was just one of the possible things I mentioned that might address the memory overhead issue. My intention here was just to point out the memory overhead.
If you are planning on implementing lazy loading in any case, feel free to link this issue with the one you make for that.
pnico
changed the title
Add support for lazy import
Lower memory overhead
Jun 22, 2023
Just importing many of these libraries has memory overhead that is large enough to cause problems in production especially in memory-constrained environments such as F1 instances.
Appengine customers are being directed to use these libraries for everything, including simply for getting app logs that are correlated per request (even though it's almost as easy to do this without using the python-logging library at all). Ideally this would be fine, but unfortunately the libraries are not designed in a way that allows selective or lazy imports, if you import one thing you bring in most of the library. If this increased memory overhead causes your instances to be killed, you might then need to increase the instance size and consequently your application's operating costs.
The discovery-based API client is being neglected on purpose, with long-standing bugs remaining unfixed, presumably to encourage everyone to use these libraries instead. We would like to use them, but we can't because they use too much memory.
googleapis/python-logging#623 (comment)
The text was updated successfully, but these errors were encountered: