Improvements from Franken 1.2.2 to 1.5.0 #1538
-
|
Hello, I just updated Franken from 1.2.2 to 1.5.0 and I have two questions. ConfigurationFirst, here is my prod configuration: Before the update, available RAM was like this, workers restarting every 500 request: But now with 1.5.0, here is the new RAM graph: First questionHow is this even possible that worker restart release so little RAM and consume almost no RAM? Second questionThis one may explain the first one if my understanding is correct. It's about database connections. I had continuously 80 DB connections, one for each worker: But now I have around 15 connections max: Does this mean not all workers are handling requests? ThoughtI have seen this reply: #1486 (reply in thread) which says:
Has it been introduced after 1.2.2? Is this the reason for my DB connections drop? As long as I don't have 80 concurrent requests, I won't have 80 DB connections? That's a lot of questions in the end, but I have a big sale event in a month and I'd like to understand better how are workers and threads working! In any case, thanks for the work, this is huge! 👏 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
Yeah this performance improvement was introduced in #1126 (1.3 I think). We changed it from dispatching requests round-robin-style to prioritizing lower-number worker threads, which reduces the number of connections, memory usage and contention. You should only need 80 connections if you actually handle 80 concurrent requests. The app will still be bootstrapped 80 times with 80 threads though, connections are usually only established once they are first needed. The spikes you were seeing before in memory usage were probably due to a small memory leak on big POST requests, which was fixed in #1350 and a general known memory leak in older PHP versions. Memory consumption should currently be pretty stable across requests, I'd still recommend restarting threads after a few thousand requests though. |
Beta Was this translation helpful? Give feedback.
-
|
Got it, thanks! Your answer is really helpful. I did some checking and I've seen that the app is bootstrapped at startup by each PHP thread. So that's great for me, I need the app ready as soon as possible! About |
Beta Was this translation helpful? Give feedback.




Yeah this performance improvement was introduced in #1126 (1.3 I think). We changed it from dispatching requests round-robin-style to prioritizing lower-number worker threads, which reduces the number of connections, memory usage and contention. You should only need 80 connections if you actually handle 80 concurrent requests.
The app will still be bootstrapped 80 times with 80 threads though, connections are usually only established once they are first needed.
1.5also introduced a newmax_threadsconfiguration, which allows starting threads at runtime and actually only bootstraps once needed. So a configuration like this would always have 5 threads, but bootstrap up to 80 threads once t…