I just installed wordpress 3.2.1 on a pretty fresh LAMP server (specs below). On a completely fresh wordpress install, wordpress is using all available memory (512 mb) after just a few handled requests. Pages tested (which both cause the same issue) are the pre made index page and the admin page.
Right after reboot i've just above 200 mb of memory available ($> free -m) and the available memory after each request to the wordpress instance decreases drastically, ending up in memory allocation errors on server after less than 20 requests and causing 500 server error from apache.
This issue is not occurring when using other non wordpress php pages on apache.
Non successful solutions have been to set memory_limit in php.ini and define('WP_MEMORY_LIMIT', ...) to various sizes.
System specs:
WordPress 3.2.1
PHP 5.3.2-1ubuntu4.9 (Zend Engine v.2.3.0)
Apache 2.2.14
Ubuntu 10.04 LTS 64-bit
Take a look at your apache mpm module config file. On ubuntu, it should be somewhere inside /etc/apache2/modules.available. There may be a large worker process number set for thick servers, and all the memory is used by worker processes which are not killed after request processing. Taking in account that each WP worker process uses about 40-50M of RAM, you only need 4 concurrent requests to consume 200MB, and thus all you need is to open WP dashboard because it makes a number of concurrent AJAX requests. You may want to use fastcgi configuration to be able to limit a number of PHP worker processes to save memory.
Related
I have php wordpress website hosted on IIS, have been using FastCGI, below is my fastCGI configuration
Below is screenshot of task manager
There are many fastCGI processes that are using 0% CPU but consuming certain portion of RAM, is this ok ? or there is any misconfiguration due to which this is happening
I did research online to find reason for same, but did not found anything.
As most web servers do, IIS uses its php processes multiple times before restarting them. It leaves idle processes running so it can serve incoming requests with out the extra latency delay of spinning up new processes.
I'm finding that the amount of concurrent users/visitors/connections to my woocommerce website is limited by the amount of RAM available. Each visitor seems to spawn a PHP-FPM process that is roughly 50-70 MB in size. My server has 32 GB of ram and I allocate 28 GB to PHP memory_limit and 28GB in innodb_buffer_pool_size for MariaDB. When the amount of users reaches 400-500, the server starts to run very slow and will have connection errors. Below are the PHP-FPM settings.
What I'm wondering is if the 50-70 MB per PHP-FPM process is normal. My WordPress installation does have several plugins. I could perform a bunch of tests to find out, but was hoping there were some experts out there that really understand what goes on here. In order to get to 1,500 concurrent users without server lag/hang, I will upgrade my dedicated server with 4X more cores and 4X more ram. However, it would be great to minimize the PHP-FPM process memory if there was a trick or two (like nginx caching).
Thank you for any input you can offer.
PHP-FPM settings
pm.max_children=400
pm.max_requests=500
pm=ondemand
PHP: version 7.4.13, run PHP as FPM application served by nginx
Server version: 10.3.27-MariaDB - MariaDB Server
Wordpress: 5.6
WooCommerce: Version 4.8.0
ISSUE: My website is extremely slow processing pages, and often times just hangs.
OLD environment: I used to run Apache 2.2 (from Apachelounge), PHP 5.3, and MySQL 5.5 on a Windows 2008 Web Server phyical box, hosted by Peer1 (ServerBeach). Website ran fast and reliable. At the time, I was using "mysql_" commands versus "mysqli_".
NEW environment: I now have a google compute engine VM running Windows Server 2012 R2. I installed Apache 2.4 from apachehaus.com (httpd-2.4.12-x64-vc11-r2.zip), PHP 5.6.9 (VC11 x64 Thread Safe), and MySQL 5.6.25 (64 bit). With some tweaking to the new httpd.conf and vhosts.conf files, I got my website back up and running. I also converted all the mysql_* references successfully to mysqli_*. Here's what I'm noticing: If I pull up the task manager on the apache server and watch the httpd process, every time I navigate to a website page, the CPU process climbs drastically and slowly gets back down to 0%. Often times, it'll even hit between 95-100% CPU utilization and stay there for a good 5 seconds, before slowly getting back down to 0%. Also, the apache memory utilization keeps getting larger with every page request, and never goes down. The website and mysql calls work and pages display fine, it just takes a long time to process.
I believe this to be a PHP issue, but I could be wrong. Recommendations are welcome.
Bear with me here.
I'm seeing some php.ini processes (?) running or processes touching php.ini that are using up to 80% or more of the CPU and i have no idea what would cause this. All database processing is offloaded on a separate VPS and the whole service is supported by a CDN. I've provided a screenshot of "top -cM"
Setup:
MediaTemple DV level 2 application server (the server we are looking at in the images), 8 cores, 2GB RAM
Mediatemple VE level 1 database server
Cloudflare CDN
CentOS 6.5
NginX
Mysql 5.4, ect
EDIT
I'm seeing about 120K pageviews a day here, with a substantial number of concurrent connections
Where do i start looking to find what is causing this?
Thanks in advance
Hi I am running a VPS (1GB memory) which has a client site on it with these specs:
Wordpress (no cache plugins)
Timthumb image resize script (http://timthumb.googlecode.com/svn/trunk/timthumb.php)
Shopp plugin for ecommerce (has a caching system)
Php.ini memory limit is set to 64M max per script
After restarting apache I have around 500M free memory. After only visiting this client's site in a random browser memory drops by 150-200M !!
I am trying to figure out the loophole, but I might be overlooking the obvious awnser please advise :-)
I'm assuming you're on a Linux VPS, so ... how are you looking at 'free' memory? There's a few different measures of that in your average Linux system. For instance, from my Linux box, I get:
marc#panic:~$ free
total used free shared buffers cached
Mem: 2058188 1596532 461656 0 778404 604752
-/+ buffers/cache: 213376 1844812
Swap: 1052248 0 1052248
By the first line, it would appear that 1.5gig are in use and just under 500meg are free (on a 2gig box). However, those totals include memory used for disk cache, which is the second line. Once you remove cache buffers from the counts, then only 213meg of memory are used by running processes, and 1.8gig are free.
When you have started apache, the various php process that are idle around occupy only about 10MB of memory. The number of php process depends on how many server / childs do you have.
When you access your site, PHP is executing, and increse is memory size. Tipically you end up with a PHP process that is about 50-60 MB each.
To verify type in your shell
ps -ylC apache2
and see the column RSS. Substiture apache2 with the process name of your http server
Do it after a fresh start and after visiting your site!