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 8988279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:59:03+00:00 2026-06-15T21:59:03+00:00

I’ve got a query that is running 5x slower on my staging server as

  • 0

I’ve got a query that is running 5x slower on my staging server as opposed to my local dev machine.

Stackoverflow doesn’t want to play nicely with the formatting; the query, describes, and explains are located here

Looking at the describe statements, I can’t see any difference between the local and remote schemas.

The record counts for the 2 machines are in the same order of magnitude (500k vs 600k)

Edit In Response to Comments

It was my highly unscientific approach of throwing the queries into MySQL Workbench and looking at the query time. The local query time was on the order of 1.3 seconds and the remote query time was on the order of 5.2 seconds (so its 4x as slow). I’m sure there’s a better way to test this query time.

The machines are different. My dev machine is a Mac Book Pro with 8 gigs of RAM. The staging server is a linode VPS with 512 megabytes of RAM. There shouldn’t be much load on the staging server (I’m the only one that uses it). I’ve noticed most queries run in approximately the same time frame on the local machine and staging server, so I was confused as to why this one had such a drastically different time frame.

RAM Issue

Since a temporary table isn’t being used (no mention in the EXPLAINS), is the amount of RAM still an issue?

Output from free

             total       used       free     shared    buffers     cached
Mem:        508576     453880      54696          0       4428     254200
-/+ buffers/cache:     195252     313324
Swap:       262140      19500     242640

Profiling Added to Gist

It looks like the remote is taking 2.5 seconds ‘sending data’ whereas the local is only taking 0.5 seconds. Is this an I/O issue? (Complete profiling info in gist)

  • 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-15T21:59:04+00:00Added an answer on June 15, 2026 at 9:59 pm

    Your staging server has one sixteenth of the RAM that you Mac Book Pro has.

    Without knowing how much RAM is available to your two instances of MySQL, it’s hard to be definitive, but that’s the first place I’d look.

    Also, if you run these queries from the MySQL command line, locally, how do the times compare?
    It could be that the increase in time is in network transfer and not query processing.

    Actually… network transfer time is the first place I’d look… then MySQL memory usage.

    EDIT following question updates

    The ‘sending data’ phase is the phase where the server is sending data to the client ref. I don’t know exactly how large your dataset is, but 2.5s seems pretty high for what’s probably 50kB of data or so.
    Having looked at the profiling data, nearly all the time is spent sending data, so I’d strongly suspect the network here.

    EDIT 2

    Some research lead me to this page which indicates that the ‘Sending data’ is misleading and that this is actually the time spend executing your query.

    Thus, I really think you need to be looking at CPU and memory usage on your server since it’s specced at a level so much lower than your MacBook.

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

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a small JavaScript validation script that validates inputs based on Regex. I
I want use html5's new tag to play a wav file (currently only supported
I'm interested in microtypography issues on the web. I want a tool to fix:

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.