Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8500101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:51:06+00:00 2026-06-11T00:51:06+00:00

I’m looking to optimize my setup on EC2. CentOS 6, nginx 1.0.15, php 5.4.4

  • 0

I’m looking to optimize my setup on EC2. CentOS 6, nginx 1.0.15, php 5.4.4 with php-fpm, xcache 2.0.0, mysql 5.5.24-55-log, redis 2.4.10, EC2 High Cpu XLarge (c1.xlarge 8 cores, 7G ram) for high traffic site, writes on every request. Resulting web request is very small (javascript snippet).

Basically, it is a 100% dynamic environment (insert or update). On every web request, I need to look in memcached for a quick lookup, then log a few attributes with every page request. I have several EC2s around the world helping to serve 600M+ requests per day. The idea is that I log the data and dump it hourly to be processed by some other machines. Each machine has been handling about 20M a day. I’ve tried a few data stores and some notes are as follows:

MySQL

  • using hourly tables to for the data so write to log_2012_09_05_11 exclusively for 9/5/2012 at the 11am hour.
  • Using ephemeral storage
  • MyISAM has proved to be faster than innodb for me. I’ve played with the buffer pool and I always seem to get better performance with myisam. Open to any suggestions on tuning here too, but the queries are fast. Myisam lock time are very tiny.
  • I profiled the code using xdebug and under high load, 98% of the time was spent connecting to mysql. I was then able to get better performance by using persistent connections with mysqli.
  • Max ~2200 rps, get gateway timeouts and slow response afterward
  • Server load max 1 or 2 (8 core machine)

Redis

  • I really thought this would be awesome, but it seems like php is the bottleneck.
  • Max ~5-600 rps.
  • This is with writing keys like this “log_2012_09_05_11_12345”, with 12345 coming from a INCR counter by the hour.
  • Saving to disk once every 15 mins (operation took about 2mins if I remember correctly)

How many requests per second can I realistically expect out of this EC2 machine and 100% write scenario? Am I bound by EC2’s disk performance or php or mysql? Can I configure it to use more CPU or better use the resources it’s using?

PHP-FPM
http://pastebin.com/raw.php?i=9n2cpqrq

NGINX (nginx.conf)
http://pastebin.com/raw.php?i=XuVBKr8m

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T00:51:08+00:00Added an answer on June 11, 2026 at 12:51 am

    I really think you need to look into splitting out your architecture components onto different systems. For example, you noted that you are running MySQL on ephemeral storage. This seems odd for MySQL in that your data could easily be lost. Have you considered using Amazon RDS?

    Also, instead of REDIS have you considering ElasticCache or SimpleDB for your Key-Value store.

    I guess my main point is that, if you are dealing with the volume of requests that you are, you really should be breaking up your service stack into multiple tiers that can scale independently of each other.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a jquery bug and I've been looking for hours now, I can't
I would like to count the length of a string with PHP. The string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
this is what i have right now Drawing an RSS feed into the php,
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to create an if statement in PHP that prevents a single post
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.