I install word-press on my Ubuntu server. I only have 3 blog post but it reach max_connection within hour.So whenever my user kit my blog it's show database establish error. my log file have following entry
server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting
[Mon Jun 20 06:30:21.877663 2016] [mpm_prefork:notice] [pid 43436] AH00169: caught SIGTERM, shutting down
my default max_connection is 200 now i increase it to 1024.
Related
I have a problem after moving PHP MySQL program from dedicated hosted server to home server.
The problem is the time php need for showing a page with 800 rows (html formated)
I have a table with 816 rows (64 fields) 320Kb. The problem I'll explain is the same on all table. I added an index but no changes. I made MySQL table analyse. Every table is listed as OK and nothing changes.
Running SELECT * FROM myTable LIMIT 1000 directly in MySQL:
Dedicated distant server : 0.02 second
Home server via DynHost : 0.01 second
Home server via local network : 0.01 second
Running SELECT * FROM myTable LIMIT 1000 in PhpMyAdmin:
Dedicated distant server : 27 seconds
Home server via DynHost : 40 seconds
Home server via local network : 25 seconds
Running SELECT * FROM myTable LIMIT 1000 in program:
Dedicated distant server : 4 seconds
Home server via DynHost : 113 seconds
Home server via local network : 113 seconds
The code (PHP) is exactly the some on both servers.
In the program the speed is the same over DynHost or via local network.
As asked by Juanga, server API was running as Apache handler. Actually the server is running:
Ubunutu 16.04.3
Apache 2.4.18
PHP 5.6.33
MySQL 5.7
phpinfo -> Server API FPM/FastCGI (thank to Juanga)
With FPM/FastCGI the times are the same as before.
I hope somebody has an idea where the problem could come from.
Yves
EDIT: #Juanga
Apache log:
[Tue Feb 20 20:51:24.097192 2018] [ssl:warn] [pid 31539] AH01909: gs3-server.home:443:0 server certificate does NOT include an ID which matches the server name
[Tue Feb 20 20:51:24.120307 2018] [ssl:warn] [pid 31540] AH01909: gs3-server.home:443:0 server certificate does NOT include an ID which matches the server name
[Tue Feb 20 20:51:24.122216 2018] [mpm_prefork:notice] [pid 31540] AH00163: Apache/2.4.18 (Ubuntu) OpenSSL/1.0.2g configured -- resuming normal operations
[Tue Feb 20 20:51:24.122232 2018] [core:notice] [pid 31540] AH00094: Command line: '/usr/sbin/apache2'
[Tue Feb 20 20:54:24.650985 2018] [:error] [pid 31545] [client 178.198.93.202:49568] PHP Warning: include(page_content/con_car_search.php): failed to open stream: No such file or directory in /srv/start.php on line 34
[Tue Feb 20 20:54:24.651017 2018] [:error] [pid 31545] [client 178.198.93.202:49568] PHP Warning: include(): Failed opening 'page_content/con_car_search.php' for inclusion (include_path='.:/usr/share/php') in /srv/start.php on line 34
I found this before I cleaned the log file:
[Tue Feb 20 19:47:22.938070 2018] [mpm_prefork:notice] [pid 12711] AH00169: caught SIGTERM, shutting down
I'm creating a service with php that returns json data from a table that contains 2100 rows. I'm using the following setup in dev:
Xampp with Apache and MySql
Windows 10
PHP-7.0.8
With PDO in php to execute the query
The service was working perfectly for both small requests (30 rows) and the entire table. I was calling it fairly often but had no problems. Recently it stopped working for requests that return the entire table and only works for the smaller requests.
I checked the Apache error logs and got the following:
[Sun Nov 20 11:06:06.687051 2016] [mpm_winnt:notice] [pid 4576:tid 536] AH00428: Parent: child process 11908 exited with status 1 -- Restarting.
[Sun Nov 20 11:06:06.889267 2016] [mpm_winnt:notice] [pid 4576:tid 536] AH00418: Parent: Created child process 924
[Sun Nov 20 11:06:07.415857 2016] [ssl:warn] [pid 924:tid 436] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sun Nov 20 11:06:07.442378 2016] [mpm_winnt:notice] [pid 924:tid 436] AH00354: Child: Starting 150 worker threads.
I have done a search for the solution although I am not sure what the issue is in order to search effectively. Each error message above appears to give me answers that do not relate to the issue I'm having (although, I'm not fully sure what the issue is).
Anyone know why something like this might happen?
My guess would be memory limitations (the children are being killed by the server). You can increase it but it won't solve the issue - what happens when you have 1 million records?
My advise is that you implement a pagination params and a max number of records to return:
http://website.com/api/v1/getUsers?position=0
http://website.com/api/v1/getUsers?position=100
http://website.com/api/v1/getUsers?position=200
etc..
This will drastically lower the stress on your system and enable the users to also lower their throughput in the event they only want the top x records, last 2, etc..
If you still want to be able to serve all, you can check this thread out to learn how to increase the memory for Apache: https://stackoverflow.com/a/36920556/1935500
I have seen some topics about 'zend_mm_heap' corrupted and 'child process exited with status nnnnn' but none of this topics lead to a solution. What does status 1 means in clear text, it is not clear what exactly happen.
Symptoms
This problem does not occur when the site is running without being logged in. Only when I logged in the problem sometimes happen when refreshing the page. Strange is that sometimes the html fails to load and sometimes resources like a CSS file or JS file. I also have seen that some resources take 6 seconds to 10 seconds to load. I think this is caused by restarting the server because of this error.
When above symptoms occur, the following (similar) info is written to the error.log file:
Error in error.log file:
zend_mm_heap corrupted
[Sun Feb 09 03:56:57 2014] [notice] AH00428: Parent: child process exited with status 1 -- Restarting.
[Sun Feb 09 03:56:57 2014] [notice] AH00455: Apache/2.4.3 (Win64) configured -- resuming normal operations
[Sun Feb 09 03:56:57 2014] [notice] AH00456: Server built: Aug 18 2012 14:13:48
[Sun Feb 09 03:56:57 2014] [notice] AH00418: Parent: Created child process 3460
[Sun Feb 09 03:56:57 2014] [notice] AH00354: Child: Starting 64 worker threads.
Configuration:
Intel I7 (Quadcore) chipset, 16GB RAM
Running latest XAMMP (or Z-WAMP, in both the same problem - see for Z-WAMP also http://zwamp.sourceforge.net/) on Windows 7 64 bit
Running APC -
For example:
Normal feedback (when problem does not occur):
What I want to know
Does have somebody info about Apache status 1 exit?
Am I able to debug this, how can I debug this?
There is a problem with APC (I use version 1.3.1) that cause this error, corrupt memory for some reason. I believe it has something do with session data because the problems only occur when logged in. My PHP class uses only a session when it is required to be logged in to be able to view the page. I have also checked my code but there is nothing abnormal or incomplete.
When I turn off the Windows extension php_apc.dll in the php.ini file everthing is working fine. No memory corruption and no delays. Also tried other cache extensions like xCache, eAccelerator, memcache and loads normally.
So I qualify this as a bug.
Setup:
EasyPHP Dev server 13.1VC11 (Apache 2.2.4, MySQL 5.6.12, PHP 5.5.0)
Windows 7.
Apache is set up with multiple virtual hosts each pointing to a separate folder under ...data\localweb\.
Server also acts as a gateway between internet and local network.
My wife has made a webpage which includes JavaScript and jQuery and PHP.
When I open a browser on my server computer and access the pages, everything works as they should. Via both these addresses:
http://127.0.0.1/liselotte/projekt5/2vs.php
http://liselotte.mine.nu/projekt5/2vs.php
However, when I try to access the page from another computer on my local network, the two longer pages in my wife's project gets truncated. (file 2vs.php, also accessible on the page's main menu as "V/S") It always gets truncated at the same place, in the middle of a 8-letter word, in a piece of HTML formatted text.
I use Firefox and can see when the code cuts off before the browser displays an error message that "transfer was aborted". (It's in Swedish, so I'm a bit uncertain about the exact wording of the message) "The connection to the server was severed during retrieval of the page". (no HTTP-error number)
I have also tried Internet Explorer and Chrome, transfer is cut off at the exact same place every time.
Weirdly enough, the page seems to work when accessed from internet.
The Apache config file contains
Listen 127.0.0.1:80
Listen trilliadin.mine.nu:80 #which is one of the virtual hosts
Listen 192.168.137.1:80 #which is Windows local address assigned to my LAN
I've tested disabling all firewalls, but no difference.
I dumped about 4MB text into a file.html to see if this also gets truncated but the whole text-file gets transferred.
Does anyone recognize these symptoms?
EDIT:
Regarding error-reporting... I do get some weird apache-errors when I start the server.
[Wed Jan 15 21:13:37.989659 2014] [mpm_winnt:notice] [pid 968:tid 424] AH00424: Parent: Received restart signal -- Restarting the server.
Failed loading D:\EasyPHP\binaries\php\php_runningversion\php_xdebug-2.2.2-5.4-vc9.dll
PHP Warning: PHP Startup: in Unknown on line 0
[Wed Jan 15 21:13:39.861663 2014] [mpm_winnt:notice] [pid 968:tid 424] AH00455: Apache/2.4.4 (Win32) PHP/5.5.0 configured -- resuming normal operations
[Wed Jan 15 21:13:39.861663 2014] [mpm_winnt:notice] [pid 968:tid 424] AH00456: Server built: Apr 8 2013 13:46:39
[Wed Jan 15 21:13:39.861663 2014] [core:notice] [pid 968:tid 424] AH00094: Command line: 'D:\\EasyPHP\\binaries\\apache\\bin\\apache.exe -d D:/EasyPHP/binaries/apache'
[Wed Jan 15 21:13:39.861663 2014] [mpm_winnt:notice] [pid 968:tid 424] AH00418: Parent: Created child process 5240
[Wed Jan 15 21:13:40.017663 2014] [mpm_winnt:notice] [pid 5328:tid 436] AH00364: Child: All worker threads have exited.
Failed loading D:\EasyPHP\binaries\php\php_runningversion\php_xdebug-2.2.2-5.4-vc9.dll
PHP Warning: PHP Startup: in Unknown on line 0
[Wed Jan 15 21:13:41.655666 2014] [mpm_winnt:notice] [pid 5240:tid 432] AH00354: Child: Starting 64 worker threads.
But I don't understand what it means. Tonight, the Virtual Host liselotte.mine.nu became unresponsive, while virtual host trilliadin.mine.nu continued working. The problem resolved when I restarted the apache server. (see error log above)
I'm having a rather big problem with a site performance. It's a php site on Apache on Windows Server 2003.
Web site is basically crashing with 'connection was reset' or 'cannot load web page' quite often. httpd process in Windows takes about 100mb on normal traffic, having about 1gb of memory still free
This is first time I host a php site on Windows (WIndows was requirement in this case) and I'm not sure what are my options
Thanks
Apache log is displaying the following (sorry for pasting it like that, couldn't do it as 'code block' from some reason. This surely doesn't look right. Any ideas what could be going on?
[Tue Nov 08 16:44:43 2011] [notice] Parent: Received restart signal --
Restarting the server.
[Tue Nov 08 16:44:43 2011] [notice] Child 2072: Exit event signaled.
Child process is ending.
httpd.exe: Could not reliably determine the server's fully qualified
domain name, using 192.168.67.1 for ServerName
[Tue Nov 08 16:44:44 2011] [notice] Apache/2.2.17 (Win32)
mod_ssl/2.2.17 OpenSSL/0.9.8o PHP/5.2.17 configured -- resuming normal
operations
[Tue Nov 08 16:44:44 2011] [notice] Server built: Oct 18 2010 01:58:12
[Tue Nov 08 16:44:44 2011] [notice] Parent: Created child process 7692
httpd.exe: Could not reliably determine the server's fully qualified
domain name, using 192.168.67.1 for ServerName
httpd.exe: Could not reliably determine the server's fully qualified
domain name, using 192.168.67.1 for ServerName
[Tue Nov 08 16:44:44 2011] [notice] Child 2072: Released the start
mutex
[Tue Nov 08 16:44:44 2011] [notice] Child 7692: Child process is
running
[Tue Nov 08 16:44:44 2011] [notice] Child 7692: Acquired the start
mutex.
[Tue Nov 08 16:44:44 2011] [notice] Child 7692: Starting 1000 worker
threads.
[Tue Nov 08 16:44:44 2011] [notice] Child 7692: Starting thread to
listen on port 2090.
[Tue Nov 08 16:44:44 2011] [notice] Child 7692: Starting thread to
listen on port 8011.
[Tue Nov 08 16:44:44 2011] [notice] Child 7692: Starting thread to
listen on port 8080.
[Tue Nov 08 16:44:44 2011] [notice] Child 7692: Starting thread to
listen on port 443.
[Tue Nov 08 16:44:44 2011] [notice] Child 7692: Starting thread to
listen on port 80.
[Tue Nov 08 16:44:45 2011] [notice] Parent: child process exited with
status 0 -- Restarting.
httpd.exe: Could not reliably determine the server's fully qualified
domain name, using 192.168.67.1 for ServerName
Windows event viewer is throwing the following
Error - VsJITDebugger. An unhandled win32 exception occurred in httpd.exe [4416]. Just-In-Time debugging this exception failed with the following error: Debugger could not be started because no user is logged on.
Can anyone help with this?
That '[notice] Parent: child process exited with status 0 -- Restarting' is describing the issue here. Tho it describes it in vary vague way. Server is basically restarting on it's own every few minutes. I took the site down with a holding page and the error and restart ddidn't occure. I added an html page and bombed it with combinations of requests using AB. It would always crash at requests close to number of ThreadsPerChild specified in mpm config, which I have set to 1000. Each crash followed with an error
apr_socket_recv: An existing connection was forcibly closed by the remote host.
(730054)
That error only displays when benchmarking. Nothing like that appears in apache log. As soon I switch the site back live, it starts to crash every few minutes. The site generates about 100 requests per page and is also using 2-3 ajax calls per page (while loading)
I spent hours searching the web for possible solutions. Found nothing that fits. I'm completely out of options. I'm not even experienced running apache on windows as during 5 years I work in the business I never had to run php sites on Windows. I haven't seen such error on linux neither
There are two places where you should have a look:
Regular Apache logs, located in the logs folder inside Apache installation.
Windows event viewer, located in Windows control panel
In particular, the second one will log Apache crashes and will possibly reveal additional details.