Skip to main content
Topic: Mysql or Apache worker tuning (Read 4154 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Mysql or Apache worker tuning

Hi guys!  I have a question to address a couple of issues I'm having on an SMF install.  Hope that's OK here.

A fairly large site 1.1M posts, returns a 500 error when trying to access the stats page or search.  Otherwise the site is smoking fast.

The install is on a dual core VPS with 2G memory, apache worker, and sphinx search.  I suspect the issue lies with either apache or mysql tuning.   Anyone have pointers?  Where should I start?  Thanks!

Re: Mysql or Apache worker tuning

Reply #1

I hope with "search" you mean not access the ?action=search page, but rather when waiting for the search results, right?
Bugs creator.
Features destroyer.
Template killer.

Re: Mysql or Apache worker tuning

Reply #2

Quote from: emanuele – I hope with "search" you mean not access the ?action=search page, but rather when waiting for the search results, right?

Ah, yes.  Thanks for pointing that out.  The error occurs awaiting the results. 

Re: Mysql or Apache worker tuning

Reply #3

Did you check the error log? I don't know anything about Sphinx, but I'm sure it also has an error log.

Re: Mysql or Apache worker tuning

Reply #4

The Statistic Page is not accessing Sphinx as far as i can see. I would check the Apache (Error) Log files

Re: Mysql or Apache worker tuning

Reply #5

Thanks guys.  The apache error logs are clear.  I can't help but think both symptoms hold a common root cause.  If so, sphinx is an unlikely culprit.  Could the apache memory limits be too low?

Re: Mysql or Apache worker tuning

Reply #6

What are the memory limits you have it set to?

Re: Mysql or Apache worker tuning

Reply #7

Your error log might not be setup correctly or you might be looking at the wrong one. When you hit an Apache/PHP memory limit it gets logged. Please post your httpd.conf and php.ini. MySQL shouldn't have anything to do with it but it's always a good idea to check that error log to make sure nothing bad is happening. It's a good idea to check all of your error logs, really.

Re: Mysql or Apache worker tuning

Reply #8

Maybe @Spuds in his role of Sphinx Master can have an idea. :P
Bugs creator.
Features destroyer.
Template killer.

Re: Mysql or Apache worker tuning

Reply #9

Seems like a 500 is going to be some PHP error

Look at phpinfo to see where its log is located and see if it has anything in it.   If its empty, you may need to set/add error_reporting = E_ALL in your php.ini (just add it at the end).  Then create the 500 error again and check the log (and be sure and remove the above line).  

It could also be sphinx, if you are running a version that is not compatible with the config file.  I think the smf one requires the separate api file, you have to get that from the sphinx distro.

Re: Mysql or Apache worker tuning

Reply #10

Now I'm getting a warning in the error log:

PHP Warning:  set_error_handler() expects the argument (error_handler) to be a valid callback in /public_html/index.php on line 110


Not sure that would cause death and destruction upon a search, or in the stats.

Re: Mysql or Apache worker tuning

Reply #11

What SMF version? No idea how your error handler got messed up. Is /Sources/Errors.php there and this line - https://github.com/SimpleMachines/SMF2.1/blob/d23bfa98183bfd23485d68c6032c3c0adf4bab4a/Sources/Errors.php#L210 is there? If it is, try commenting out that line in index.php and see if PHP logs the error properly.

Re: Mysql or Apache worker tuning

Reply #12

Quote from: Joshua Dickerson – What SMF version? No idea how your error handler got messed up. Is /Sources/Errors.php there and this line - https://github.com/SimpleMachines/SMF2.1/blob/d23bfa98183bfd23485d68c6032c3c0adf4bab4a/Sources/Errors.php#L210 is there? If it is, try commenting out that line in index.php and see if PHP logs the error properly.

Good call on the version - it is a 2.1 install.  Commenting that line in index.php results in the same error log entries.

Could there be a relationship to apache worker as opposed to apache prefork?  I made the switch recently......that's why I wondered if it could be tuning related.

Re: Mysql or Apache worker tuning

Reply #13

I wrote a pretty comprehensive guide to Debian Wheezy a few years back:

http://hexwiki.com/wiki/Debian_Wheezy

Things are pretty much the same for Jessie, though I haven't made a specific guide for it yet.

Re: Mysql or Apache worker tuning

Reply #14

Very nice !