-
Notifications
You must be signed in to change notification settings - Fork 336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
memcached error on process startup #1524
Comments
Okay, I have not been able to discover the cause of this, except that it appears to be leading to higher CPU usage, and it only appears on the busy services. And I can confirm this happens each time unit recycles a process after processing the number of requests assigned to |
In the version of libmemcached I'm looking at MEMCACHED_POINTS_PER_SERVER is 100
So, this seems to indicate that the number of memcache servers that libmemcache thinks there is, is > 100. OK, here's some docs
I wonder if this is what you are hitting? Each time Unit restarts the app it re-adds the same servers. I'm not entirely sure how that would be happening (it would mean some state is being maintained between restarts). Something you could try is adding a call to resetServerList() before you add the servers... |
Thanks @ac000 that appears to have helped. Will monitor the logs and keep you posted. |
Yeah this does solve the problem, but it does mean that Unit processes have an element of state between each restart? |
Cool...
That's the bit I'm curious about. New application processes get fork(2)'d off of the 'prototype' process and that shouldn't have executed any PHP scripts. My current suspicion is that PHP/libmemcached is keeping some state some place... |
Maybe it's related to opcache. Could try and see if this happens with opcache disabled, but not sure why that would make a difference. Because if no php is executed as you say, then there is nothing cached at the prototype process level. |
Maybe you have this enabled...
Not that I know for sure if this could cause the issue... |
No, this is what I have enabled. https://github.com/islamic-network/api.aladhan.com/blob/bc8fef29420a11a4c8cd570eed2f304f2377c753/config/kipchak.memcached.php#L17. There's no state or and there are no sessions anywhere. But what is strange is that it does not happen the 100th time the same process executes the php code. It happens whenever a new process starts. Or maybe it does happen the first time a new unit process hits the 100th request - that's not easy to tell with the volume because we would probably hit the 100 count in a couple of hundred ms - but then I would think it would happen on every subsequent request too. But this can be tested offline quite easily, I'll see if I can do that next week. Not sure it warrants leaving the issue open, though. |
I'm running a PHP in container built on
unit:php8.2
. Here is the Dockerfile I'm using: https://github.com/islamic-network/php/blob/master/8/8.2/Dockerfile.nunit.Every few seconds I'm seeing the following in my logs:
Unit limits are set, so each process is killed and a new one comes up after serving 10,000 requests. I suspect this is happening each time 10,000 requests are served because I'm serving between 200 and 400 a second which is why I'm seeing it so often.
There's no connectivity problem between the PHP and memcached containers.
Still investigating, but just thought I'd report this here.
The text was updated successfully, but these errors were encountered: