Solved

WordPress, AWS and memory starvation

Posted on 2016-09-08
5
114 Views
Last Modified: 2016-09-12
I needed to upgrade a little WordPress site to an ExtraLarge partition today since httpd was failing to start due to a memory problem. The suggestion by AWS was to run MySQL on a different instance than WordPress. Meanwhile, I need to pay more for that server.

He also said there could be a memory leak in the code.

What kinds of things could cause a memory leak in the WordPress code?

How confident are you the problem will be solved when I decouple the DB from my Web Server?

Thanks.
0
Comment
Question by:newbieweb
  • 2
  • 2
5 Comments
 
LVL 28

Accepted Solution

by:
chilternPC earned 250 total points
ID: 41791399
if you have a memory leak in your code then moving the and decoupling things is not going to fix that.

Have you checked or set  the memory limit in your wp-config.php file in the root wordpress folder?

look for 'WP_MEMORY_LIMIT' in the wp-config.php file and either increase it to 64M  or add the line inside the main php tag:
 
define('WP_MEMORY_LIMIT', '64M');

If you still get the error after this change, then please contact your AWS. Most likely, they would have to go in their php.ini file to increase the memory limit for you.
1
 

Author Comment

by:newbieweb
ID: 41791609
A) He suggested a memory leak as a possibility, but is that even possible with WordPress?

B) He suggested the real cause we do not have enough memory is that one server hosts WordPress AND MySQL.

What are the odds it B?
0
 
LVL 12

Assisted Solution

by:William Nettmann
William Nettmann earned 250 total points
ID: 41792864
a) WordPress, or a theme or plugin, could conceivably have a memory leak. The generally accepted approach to find the source of a problem in WordPress is to disable all plugins and revert to a default theme, e.g. Twenty Sixteen, check if the error continues (if it does, WordPress, data, config or environment is the problem) and if not, add back each plugin and theme one at a time to see which one causes the issue.

b) Many WordPress installations run the web server and MySQL on the same server - and often, PostFix, Bind, Dovecote and other services as well. It is unlikely that running the web server (WordPress) and MySQL on the same server is a problem as such.

The most probable solution to your problem, all things being equal, is to allocate more memory to your AWS instance, and yes, pay more for it.
1
 
LVL 28

Assisted Solution

by:chilternPC
chilternPC earned 250 total points
ID: 41793160
did you check the  memory limit in your wp-config.php file in the root wordpress folder?
1
 

Author Closing Comment

by:newbieweb
ID: 41794253
thanks
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Is your company's data protection keeping pace with virtualization? Here are 7 dynamic ways to adapt to rapid breakthroughs in technology.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question