Replies: 1 comment
-
@pfk84 thanks for bringing this up 👍 This is actually the best way to go about this, @clue did something similar in clue/reactphp-redis#130 and already has plans for mysql: friends-of-reactphp/mysql#147. I think using a small idle time is the way to go, as it doesn't make sense to keep the connection open for a whole 60 seconds. Using the 1ms you suggested should cover most cases. Additionally I think it is a good idea in the future to make this idle time configurable, otherwise it is hard to find a solution that fits into everybody's use case. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When running my project without the built-in webserver via php-fpm & nginx (to overcome the current request content length limit of 64kB) I stumbled upon an issue with e.g. the Async MySQL client as its default behavior is to keep the database connection open for 60s. Same applies for other async clients with similar features, of course.
This leads to the PHP execution not finishing until this timeout is reached; thus php-fpm does not send the output and nginx throws a Gateway Timeout.
Unfortunately, stopping the loop after
sendResponse()
prevents a graceful database disconnect which then in return leads to error log entries in the database server... One workaround I found was setting the idle timeout to 0.001s but I was wondering if there's maybe a better way or best practises in general for similar cases.Beta Was this translation helpful? Give feedback.
All reactions