Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Nginx + php fpm + APC
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Nginx + php fpm + APC

RolterRolter Member

I am having this weird problem of random blank pages on my server that is dedicated to just a single site which is using cloudflare , mainly for caching and reverse proxy (i guess most people use cloudflare for the same purpose).

My server has nginx , php fpm , apc and unfortunately i am using the remi repo.

Also i have ruled out any DDOS by using netstat , which shows only the IP's from cloudflare making more than 3 requests at any given time

The site hosted on the server receives 3M+ page views per day , but that has been stable for over a month ,I started having problems only over the pass week.

I hope someone can help me out , if not i am willing to hire a server admin to detect and fix the issue (of course i need to know what the problem is as and when you detect it)

Comments

  • MunMun Member

    Well mind providing more info? What application are you using, i.e. wordpress? What OS? what pages, etc?

    Mun

  • RolterRolter Member

    Thank for you reply , the OS is centos 6.4 and its a custom script (nothing fancy , just plain old procedural code) ,also i am using virtualmin , if that matters.

    Every page on the site shows blank page every now and then (their are total 4 pages on the site , but they are all dynamic php pages).

    I have checked the error logs (both nginx and php fpm )and other than normal notice about missing offsets , i dont see anything .

    If you want , i can post my logs here .

  • Sounds like a timeout issue

  • By default PHP error messages are not logged. You have to add the following to your PHP-FPM pool configuration file:

    catch_workers_output = yes

    Once you do the above will you see error messages in your nginx log file.

    If this doesn't work you can try alternatives:

    http://serverfault.com/a/387170

    After you have some decent error messages logged post here and we'll see what might be causing this.

  • RolterRolter Member

    I think i have found the problem ,i saw PDO 1040 too many connections (i have only recently migrated the entire site to PDO from mysql) and have increased the total number of allowed connections to mysql from the default 151 to 250 , site is working for now and i have browsed more than 100 pages without any blank pages ...will probably have to use a benchmark to be sure of the error not appearing again.

    And since my connector.php file was the first file included in every php page , ,i was getting the usual blank page (due to mysql not connecting and thus terminating the script )

    Turned on the PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING and fixed that .

    For anyone who might need help with this --

    open your /etc/my.cnf and add this line under the [mysqld] section
    max_connections=250

    Adjust 300 according to your apps needs.

    Hopefully no more blank pages for me

  • DerekDerek Member

    Try restarting PHP-FPM and make Nginx is properly sending the requests to the FPM process.

  • MunMun Member

    Also sockets might help.

Sign In or Register to comment.