The backend of one of our web applications uses MySQL on Linux. It all works very well and fast.

But I also do a lot of my development on OS X, and have the complete live environment mimicked there. It all works correctly, but when several MySQL queries are run concurrently (due to some simultaneous Ajax calls), the MySQL on OS X responds annoyingly slow.

Both on Linux as OS X it's a stock install of MySQL, is anyone aware of a difference in default settings that could cause such a slowdown on OS X?

Edit some extra info, as requested

  • There are only MyISAM tables
  • I don't think the queries themselves are to blame, since they run fast when run one after the other, just not in parallel
  • I have no idea at this time what the maximum number of users is for MySQL, those kinds of possible causes were what I was looking for when asking the question ;), I'll check it out
  • 1
    This is not sufficient information to make even an educated guess. You might be looking at anything from table-locking on MySQL (MyISAM vs InnoDB) to poorly written queries, to reaching your maximum allowed users on MySQL (or Apache). Please provide more information. – user3914 Sep 11 '09 at 13:45
  • Did you build MySQL from source on your OS X machine? Or did you pull down a prebuilt package from someplace? – Josh Budde Sep 11 '09 at 14:25
  • it's the prebuilt package, 32 bit mysql 5.1.30 – Pieter Sep 11 '09 at 14:28
  • "I don't think the queries.." Shouldn't you be finding out instead of guessing? Or worse, asking us to guess for you? MySQL itself can give you the answers to these questions. – John Gardeniers Sep 11 '09 at 16:44
  • @John maybe quote in full "...they run fast one after the other, just not in parallel" what more can I do then see that a couple of queries each take half a second when run consecutively, but take over 20 seconds when run simultaneously? – Pieter Sep 12 '09 at 2:09

If you're running a good chunk of memory, you should set your MySQL install to use the my-huge.conf configuration file. If you're using the default install the defaults are probably far too conservative for your hardware.

HERE is a good article about MySQL configuration files


are those read-only queries or also updates?

if updates - do consider switching to innodb, myisam [as fa as i know] uses global lock whenever data is changed - so it does not utilize multicore capabilities.

  • all queries are read only... – Pieter Sep 11 '09 at 14:39

Apple.com has a few great tips: Improving MySQL Performance



did the trick for me for some reason.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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