AWS ec2 instance shutting down again and again with wordpress - php

I have uploaded a wordpress site on t1.micro but there is a problem with database connectivity , It was going down multiple times(6-7 times in a day) and every time I need to restart mysql/apache server. Then I updated my instance to t2.micro to enhance the memory size but the problem was still there. Then after reading lots of forums I again decided to increase the memory size so again I updated to t2.medium
Model vCPU CPU Credits / hour Mem (GiB) Storage
t2.medium 2 24 4 EBS-Only
On many forums related to wordpress and aws, it was given that it is because of low RAM and mysql error log can help you to find out the exact issue.But when I checked mysql error log there is noting to display.
Now my RAM size is very large but the problem of shutting down server/mysql is still there.
Is there anybody who can help me to get out of this. Thanks in advance.

Related

AWS RDS goes 100% with number of DB connections

I have deployed a Laravel 4.2 based project on AWS.
I am facing an issue, when there is a load on my site RDS touches 100% CPU utilization.
For example, last time we have a load when there were 422 DB connections.
The strange part is at the same time Write IOPS and Read IOPS are just normal, slow query logs are fine.
I need a direction, how to debug this issue. I want to know which thing is causing high CPU utilization.
Thanks

Wordpress Performance- Google Compute Engine

I am using WPMU installation and trying to import listing in my site.
I started with ns1-standard 1 (2 CPUs and 3.75GB RAM) instance of GCE. At that time import was going smoothly and I was able to import at a pace of 250 entries per hour using WP All Import.
However, that time CPU utilization went to 60-70%, which create a huge impact on live visitors on my server so I upgraded to ns1-standard-2 (4CPUs and 7.5GB RAM) and then to 11GB RAM.
Slowly performance of the import has started decreasing. I modified values of max vars, memory, max execution time to practically Infinite but now after just 15k entries speed is 80 entries in an hour. I have to import 200k entries in my server.
I am also getting sudden spikes in CPU usage. I did not have such spikes in the beginning. Also error log doesn't have anything mentioned wrt import process.
Screenshot:
Any pointers?
I'd suggest you try looking at top, oprofile, or other tools to determine what is going on with the machine that is taking the time. top can also help you determine whether RAM or CPU is the issue, and can provide much more granularity than the graph you're showing from the GCP web console. (You could also try out Stackdriver in the Basic tier to get more detail on the resource utilization, which might help you figure out the spikes).
One note - you say you're using an n1-standard-1 with 2 CPUs and 3.75GB RAM, but that is not a combination we have. An n1-standard-1 would have 1 VCPU and 3.75, and an n1-standard 2 would have 2CPU-7.5GB.
An option to see if machine size is the limitation would be to power down the VM, change the size to something big like an n1-standard-32, restart, and see if it goes faster.
Another thing to investigate would be whether you are limited by disk performance. Note that our PD (boot disk) performance is related to the overall size of the disk. So if you created a very small disk, and if it is now getting full as you do more imports, it could be that you need to increase the size of the disk to get more performance.

Process running php.ini Using Up Excessive Memory In CentOS

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

Sugar CRM - Performance Issues

I am trying to identify why my Sugar CRM sites are loading so slowly. I am hosting 22 sites on IIS, PHP version is 5.3.26, and my databases are on a seperate SQL Server 2008. The Web Server is running Windows 2008, IIS7, 10GB memory and has a Intel® Xeon® Processor E7-2870.
After profiling one of my databaes I have ruled out the issue to be data related as queries were consistently running in less than 1 second.
My hosting provider has confirmed that we have 100mb dedicated line to our web server. After running a speed test, I get around 70 mb down and 40 mb up, so I do not think this is a bandwidth issue.
I took a look at an offical 'Performance Tweaks' article, and made changes to the config_override.php as suggested, however this did not make a signifcant difference.
http://support.sugarcrm.com/04_Find_Answers/02KB/02Administration/100Troubleshooting/Common_Performance_Tweaks/
Something I have noticed is that there is an awful lot of PHP-CGI.EXE proccesses. As I look at the server now the average CPU consumption for one of these instances is 11%. I am not sure if this is something to be concerned about? The CPU Usage in Windows Task Manager looks very unstable.
To see if it was genernal PHP issue, I added a simple PHP script containing "echo (5 % 3)."\n";" - which was returned instantly.
To summarise web pages are taking on average 5 seconds to load and users are reporting the system as usable but slugglish.
Does anyone have any suggestions of how I might be able to speed up my application?
Thanks
What does the page load time show at the bottom of the page in SugarCRM? If it shows something like 0-2s, but the page in reality takes much longer then look at adding Opcode caching such as APC or Memcache.

memory_limit = 1024M, still, Cannot allocate memory: couldn't create child process: /opt/suphp/sbin/suphp

I know that there is another question with a similar title/error, but i think this is a different problem.
Context:
Running wordpress 3.6.1, PHP 5.3.27, MySql 5.1.70, on a shared Linux host, 1gb Memory.
.htaccess: suPHP_ConfigPath /home/[username]/public_html
php.ini: memory_limit = 512M (I tried 2048M, 1024M, 32M, .. heck even -1)
I also tried (ini_set(/* all the values above, in the WordPress index.php */))
I disabled ALL plugins, I even re-enabled one by one.
I have about 300-400 concurrent connection/users on the site at the same time, on average.
I DO NOT have SSH access :/
I cannot reproduce the bug locally (On Mac running 'MAMP' and 'ab', I even lower the mem limit locally to 16m.. )
the way I know that none of that worked is that, in the /cpanel errorlog screen, I see the Error (in the title) about 3-4 times per minute !!! (12)Cannot allocate memory: couldn't create child process: /opt/suphp/sbin/suphp for /home/infomed/public_html/index.php
I already called the hosting company, directnic, and they weren't able to help me much, they suggested few of the solutions that I already tried, they don't support SSH, so that's a dead end for me. I know I can switch hosts, but I am not able to do so at the moment.
Please, all I am asking is to point out any potential other causes that I can investigate, I am out of ideas ... what could use more than 1gb of memory, in a simple Wordpress blog, all plugins disabled, on the home screen? there is no images upload happening, just 2 wp_get_recent_posts each with a limit of 6.
code here
I have about 300-400 concurrent connection/users on the site at the
same time, on average. I DO NOT have SSH access :/
This is your problem.
Shared hosting companies usually limit more than just PHP memory, you could be reaching i/o, and memory limits elsewhere. You could be inside a VM already and reaching that limit, etc. Shared hosting comes cheap but once you start throwing decent traffic at it they generally suspend your account or you start running up against limits.
I'd advise upgrading with that much traffic to something like a VPS, dedicated server or move to cloud based hosting. You're obviously doing something right with the traffic levels so move off quickly :)
Turn on your server's opcache and memcache. I've been getting this error for a few months, but after enabling opcache and memcache of the php extension everything disappeared

Categories