Topic on Project:Support desk

79.178.3.212 (talkcontribs)

Hello,

TL;DR: How to set timeout on the mySQL from the wiki?

Longer explanation:

Every now or themy wikimedia stop working, after some hours of debugging I realise that when google starts to crawl my wiki, it's make a storm and there are more then 100 CGI processes that runs without being terminated.

Every process is about 30 MB but so many kllls the ram and when it's happends the CPU raise too.

When I opened the mySql manager I was able to see that most there are also 100+ open conecctions on sleeping state.

I tried to terminated them but it wasn't release the processes on the Wiki server.

Is here a way to control the timeout so the CGI process will be closed after a minute or to to close the mySql connection after a minute?

Is there a way too deeply debug what wxactly goes wrong?

Ciencia Al Poder (talkcontribs)

The problem is not mysql not closing connections, but PHP not closing its instances.

AFAIK, running PHP as CGI should have a PHP process open all the time, which gets recycled periodically (after X requests). Maybe the server is losing connection with the PHP process somehow and opens a new one, leaving the old process open. You should check error logs or windows event viewer for abnormal PHP errors that leave orphaned PHP processes.

109.66.49.69 (talkcontribs)

Thank you for the direction, I'm still figuring it out, but thanks for the direction.

I'll update whe I'll succeed to solve it ( or not ). XD

MarkAHershberger (talkcontribs)

Reply left elsewhere:

@Ciencia Al Poder

Ok,

I figured it was two bug that was limit the system, so when google start to crawl it made DDoS.

I solved it by do two steps.

  1. Set limitation InstanceMaxRequests PHP_FCGI_MAX_REQUESTS, to 80 [EVEN THOUGH THE RECCOMENDATION IS 8 PER CPU CORE ON IIS IT MUST BE HIGHER!]. - That solved the cpu and ram issue.
  2. I changed the aplication pool user and the websites auth to be the same user - that stopped the random error 500.

I hope it would help someone in the future.

Thanks again for your directions.