Re: [pylons-discuss] DB QueuePool limit overflow and Pyramid sub-requests

2018-05-01 Thread jens . troeger
Thank you for the explanation, Jonathan! No, I didn't use *use_tweens* and perhaps will give that a try. However, considering our other conversation regarding the requests package and how to issue API calls within a view

Re: [pylons-discuss] DB QueuePool limit overflow and Pyramid sub-requests

2018-05-01 Thread Jonathan Vanasco
On Tuesday, May 1, 2018 at 1:17:31 AM UTC-4, jens.t...@gmail.com wrote: > I’ve followed the suggested cookie cutter code exactly: > https://github.com/Pylons/pyramid-cookiecutter-alchemy, which uses > pyramid_tm and adds the SQLA session to that transaction manager. > Are you passing in

Re: [pylons-discuss] DB QueuePool limit overflow and Pyramid sub-requests

2018-04-30 Thread jens . troeger
Jonathan, On Monday, April 30, 2018 at 4:17:50 AM UTC+10, Jonathan Vanasco wrote: > > How are you handling your session connection and cleanup? Are you using > pyramid_tm? If so, are you using the `use_tween` on the invoke_subrequest > to properly close each connection in the pool? If not,

Re: [pylons-discuss] DB QueuePool limit overflow and Pyramid sub-requests

2018-04-29 Thread Jonathan Vanasco
On Saturday, April 28, 2018 at 5:45:23 AM UTC-4, jens.t...@gmail.com wrote: > > From within the view function (i.e. handling the incoming request) I issue > 5 subrequests one after the other. Doing so I noticed that the number of > subrequests was bound by the pool_size + max_overflow, hence

Re: [pylons-discuss] DB QueuePool limit overflow and Pyramid sub-requests

2018-04-28 Thread Mike Orr
I'd second the recommendation to minimize the use of subrequests. A subrequest goes through the entire router overhead and just adds unnecessary complications and indirection and possible bugs. If you have two views and you want to call one from another, or one is a thin wrapper over the other,

Re: [pylons-discuss] DB QueuePool limit overflow and Pyramid sub-requests

2018-04-28 Thread jens . troeger
Hi Jonathan, Assuming you have 1 request and 5 subrequests, shouldn't there only be 2 > connections needed in the pool (i.e. the main request establishes a first > connection, then subrequest 1 establishes a second connection which is > re-used by 2-5)? You wouldn't be able to save a

Re: [pylons-discuss] DB QueuePool limit overflow and Pyramid sub-requests

2018-04-28 Thread jens . troeger
Thank you Michael, In general I strongly urge you to reconsider using subrequests... they are > there for people to use but they have lots of drawbacks versus just calling > a bunch of reusable functions. > What would you recommend then to issue a request from within a view function? Using

Re: [pylons-discuss] DB QueuePool limit overflow and Pyramid sub-requests

2018-04-26 Thread Jonathan Vanasco
I'm confused by wording on this, or perhaps the functionality in Pyramid. > When I set the pool_size of the engine to *N* and max_overflow

Re: [pylons-discuss] DB QueuePool limit overflow and Pyramid sub-requests

2018-04-26 Thread Michael Merickel
In general I strongly urge you to reconsider using subrequests... they are there for people to use but they have lots of drawbacks versus just calling a bunch of reusable functions. Anyway, this is how subrequests work - they are isolated. They do have an odd feature that sort of lets you merge

[pylons-discuss] DB QueuePool limit overflow and Pyramid sub-requests

2018-04-26 Thread jens . troeger
Hello, Perhaps this forum is more appropriate to ask than the SQLAlchemy group (see this same question over there ). I would like to understand the interplay between a SQLA session and a Pyramid’s subrequest