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

  • SEARCH
  • Home
  • 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 9123065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:14:59+00:00 2026-06-17T06:14:59+00:00

How to optimize a linux MySQL server for faster queries for tables with many

  • 0

How to optimize a linux MySQL server for faster queries for tables with many rows (up to 1 bilion).

The server is only used in development so security, availability or recovery is not an issue.

here is an example :

ALTER TABLE link ADD UNIQUE KEY url_index(url(255))
  • duration >6h
  • links count (~ 20 mil)
  • low cpu usage (~19%)
  • high IO (iotop mysql returned mostly 600 KB/s read & 500 KB/s write with 99% IO with some spikes to 2-3 MB/s )

links table:

CREATE TABLE `links` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `url` varchar(2000) NOT NULL,
  `domain` varchar(255) DEFAULT NULL  
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=27765646 DEFAULT CHARSET=utf8;

I have a dedicated linux server (ubuntu 12.10)

  • 6 GB of RAM
  • 1 TB HDD (non-SSD)

my.cnf (http://pastebin.com/vx6BNqrE)

What can I optimize in terms of software (query/table design and my.cnf or other server configs) and what should be the first to upgrade in terms of hardware other than RAM (unfortunately RAM is not upgradeable as only 3 ram slots are usable).

updatead

  • 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-17T06:15:00+00:00Added an answer on June 17, 2026 at 6:15 am

    Rather than playing around doing micro-optimizations that might give you a few more transactions an hour, you need to start scaling.

    Firstly, get an SSD. If you need more space, RAID them. If you really care about performance, SSD’s are huge, especially looking at your IO.

    Secondly, one server can only go so far. You need to start setting up slaves that will take off some of the load, they also serve as a nifty fail over.

    MySQL wasn’t really made for on-demand schema changes, so the alter table is hard to answer; I would actually take a server out of service to prevent locking, run the alter table, then sync it back up with what it missed and follow suite with the other servers. You should really just pick one schema and stick with it though.

    Best of luck!

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

Sidebar

Related Questions

How does one optimize if the parameter space is only integers (or is otherwise
In Linux kernel source code, there are many memory barrier(smp_mb() and so on). But
Is the LAMP (Linux, Apache, MySQL, PHP / Ruby / Python) stack appropriate for
I am trying to optimize this query as good as possible,but still i am
I try to optimize my pages by putting some async attributes on my scripts.
Do browser vendors optimize against jQuery? I know this sounds absurd anti-standard, but I
I want to optimize images with the help of some external programs. The programs
How can I optimize below SQL (simplified view of my complex query.) Ideally, I
I'm trying to optimize the memory usage of an iOS app, and I'd like
I would like to optimize the following code in R. This loop takes a

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.