I have followed the template and instructions from here - https://aws.amazon.com/blogs/publicsector/managing-nonprofit-members-donors-civicrm-aws/

This is a great piece. I have my production environment up and running with a modified version of this template. However, I've noticed the environment is slow. I have a t3.large setup with the Aurora DB and I have configured the ElasticCache with REDIS - this really helped but there are times the lag is unbearable or the site times out. Any suggestions?

Any pointers available to speed things up? The cache hits are around 99% and sub second for the DB so I'm thinking its the Apache server?


3 Answers 3


Well, it turned out to be my own fault for the CPU usage, etc. I had turned on monitoring by AWS for port 80 and 443. Apparently something was out of whack with that because it consumed ALOT of the server! I removed those monitors and surprise... back to normal and what I would have expected. Odd behaviour but the function isn't that important to me that I will hunt down why it was doing what it was. I used the template as posted above, have distributed support for both the web pages and the database. Quite happy with the change.


I manage an instance with around 200,000 contacts on a EC2 t2.medium (No elastic scaling). We gradually ratcheted up to an RDS t3.xlarge.

What ballpark are you in with Contacts and simultaneous users? Are you talking about performance in the back-office (i.e. CiviCRM itself), or custom solutions that integrate the Civi API?

If you are using the "default" EC2 size recommended in the blog post, I would expect problems. Also, I'm not sure it is a good idea to run Apache with the default configurations in the AMI. I use a custom image that sets limits per Civi's recommendations and per my experience.


That's my succinct answer... if you care to stay tuned for more rambling...

Thanks for posting the question, I would be curious to find out what more CiviCRM admins are doing on AWS. The blog post is written by a name I do not recognize and contains the factual error that "CiviCRM is built on Wordpress", so I don't think the author has any experience beyond writing the post. I haven't had the pleasure of trying Civi with scalable EC2 instances. Is that possible without rewriting how core handles files?

This instance is on AWS due to general IT strategic decisions, not because it was well suited for CiviCRM. If there is a reason to use AWS for Civi, I think it might be RDS.

I had to put a lot of effort into optimizing for mailings, mostly to keep them from bogging down other things. AWS SES is awesome and has just swallowed right down all I could throw at it. But I found that Apache was getting slammed with image requests when people opened the messages and was able to take that load off by tuning caching provided by CloudFlare.

The best advice is always, "Get More Information". Figure out how to profile your unique usage. You will need to look at both individual request performance, and also how things deteriorate under increased load. If you can't simulate high-demand, then look for opportunities to observe them in real-time.

With all the facility of the cloud, web servers should be getting smaller. I would recommend coming up with a few categories of requests you need the web server to perform well on and profile each step of the most intensive kinds of requests. Look to bad code or inefficient api utilization or database queries needing optimization. If you are just trying to get vanilla Civi working better, again, I think just beef up the database server.

  • I added a 'correction' comment to that blog to make it clear civi is not just a WP plugin
    – petednz - fuzion
    Commented May 10, 2023 at 4:26

Probably your instance type is not powerful enough. Also you can use ARM based instance, which is cost effective and gives better performance with gp3 EBS.

I have a m6g.large with at least another 3 websites plus one of them is civicrm with drupal, also running a docker container as well. So far no issues.

I didnt use the template you have tried, but I have fired up my own EC2 with this control panel https://www.cloudpanel.io and separately installed all softwares. This may help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.