Archive for the ‘performance’ Category

Best of Guide – Highlights of Our Popular Content

Май 24th, 2012

Read the original article at Best of Guide – Highlights of Our Popular Content

Top 5 Most Popular

We use a broad brush to highlight the biggest no-nos in web application scalability.

We dig into scalability, steering to the richest areas to focus on.

MySQL on Amazon EC2, the what, how and when.

We highlight some of the big differences between the two database engines. We’re also working on revamping this content, so stay tuned for more.

Interviewing a MySQL DBA – a guide for managers. Also helpful if you’re gearing up for an interview.

Hiring Guides

This two part guide for a hiring manager, focuses on the MySQL Database Operations role.

A long time favorite, a hiring guide for Oracle DBAs.

Devops is the latest craze in bringing the worlds of operations and development together.  We talk about how to identify and attract such a candidate.

Today the cloud is *almost* synonymous with Amazon Web Services and their Elastic Compute (EC2) cloud offering.  Want to hire the best, here’s the step-by-step guide.

Howtos

Caching caching everywhere.  Learn to do it right.

Hotbackups make building replicas a snap.  Avoid the downtime & speedup the process.

Get your backups right so you can get some sleep at night!

Learn how to automatically spinup new MySQL slaves in Amazon EC2.

Industry Commentary

A decade ago startups large and small were running on Oracle, but no longer.  As the shift intensifies, it becomes harder and harder to find the right talent.  Here’s why.

High availability ain’t what it used to be.  Here’s why nobody is really achieving so-called five nines.

We argue that technologists with broad experience are needed to achieve scalability for today’s high traffic high transaction websites.

Startup & Small Business Advice

You’ve heard all the hype.  Now for some medicine.

Our three part guide takes you through ten steps to building a successful consulting business.  This is as much a guide for freelancers or wanna be consultants, as it is for startups, and those wishing to hire good temporary resources.

Book Reviews

Learn about scalability from the guys at AKF.

Here’s a great how-to book, short and to the point.  Optimizing those queries!

Building a startup doesn’t have to mean big money. Stay efficient and build those margins.

Jeff Jarvis champions Google, but we flip the question around.

Hidden Gems

Cut through the hype.  Which types of applications really do lend themselves to deploying in the cloud?

Ask some tough questions before you deploy everything in the cloud.

Migrating your application from Oracle to MySQL, you may be in for a bumpy road.  Here are a few things to watch out for.

Soup to nuts guide to deploying applications on Amazon Web Services EC2.

For more articles like these go to iHeavy, Inc +1-212-533-6828


PlanetMySQL Voting: Vote UP / Vote DOWN

Best of Guide – Highlights of Our Popular Content

Май 24th, 2012

Read the original article at Best of Guide – Highlights of Our Popular Content

Top 5 Most Popular

We use a broad brush to highlight the biggest no-nos in web application scalability.

We dig into scalability, steering to the richest areas to focus on.

MySQL on Amazon EC2, the what, how and when.

We highlight some of the big differences between the two database engines. We’re also working on revamping this content, so stay tuned for more.

Interviewing a MySQL DBA – a guide for managers. Also helpful if you’re gearing up for an interview.

Hiring Guides

This two part guide for a hiring manager, focuses on the MySQL Database Operations role.

A long time favorite, a hiring guide for Oracle DBAs.

Devops is the latest craze in bringing the worlds of operations and development together.  We talk about how to identify and attract such a candidate.

Today the cloud is *almost* synonymous with Amazon Web Services and their Elastic Compute (EC2) cloud offering.  Want to hire the best, here’s the step-by-step guide.

Howtos

Caching caching everywhere.  Learn to do it right.

Hotbackups make building replicas a snap.  Avoid the downtime & speedup the process.

Get your backups right so you can get some sleep at night!

Learn how to automatically spinup new MySQL slaves in Amazon EC2.

Industry Commentary

A decade ago startups large and small were running on Oracle, but no longer.  As the shift intensifies, it becomes harder and harder to find the right talent.  Here’s why.

High availability ain’t what it used to be.  Here’s why nobody is really achieving so-called five nines.

We argue that technologists with broad experience are needed to achieve scalability for today’s high traffic high transaction websites.

Startup & Small Business Advice

You’ve heard all the hype.  Now for some medicine.

Our three part guide takes you through ten steps to building a successful consulting business.  This is as much a guide for freelancers or wanna be consultants, as it is for startups, and those wishing to hire good temporary resources.

Book Reviews

Learn about scalability from the guys at AKF.

Here’s a great how-to book, short and to the point.  Optimizing those queries!

Building a startup doesn’t have to mean big money. Stay efficient and build those margins.

Jeff Jarvis champions Google, but we flip the question around.

Hidden Gems

Cut through the hype.  Which types of applications really do lend themselves to deploying in the cloud?

Ask some tough questions before you deploy everything in the cloud.

Migrating your application from Oracle to MySQL, you may be in for a bumpy road.  Here are a few things to watch out for.

Soup to nuts guide to deploying applications on Amazon Web Services EC2.

For more articles like these go to iHeavy, Inc +1-212-533-6828


PlanetMySQL Voting: Vote UP / Vote DOWN

“WordPress on Amazon S3″, OblakSoft Cloud Storage Newsletter, May 2012

Май 10th, 2012

WordPress on S3: run a beautiful website on Amazon S3 cloud storage

OblakSoft is proud to introduce the 1st ever dynamic WordPress site running on top of Amazon S3: Yapixx.  Now you too can launch your own beautiful website on Amazon S3.

While Yapixx stands for Yet Another Picture Sharing Site, it is actually one of a kind.  Yapixx is WordPress that was moved to run on top of Amazon S3 storage without changing a line of code in the WordPress core engine.

 

 

What is Yapixx?

Yapixx is ready-to-run WordPress on Amazon S3.  It took about one man-week to create Yapixx, thanks to power of WordPress.  WordPress is a mature and versatile platform that powers millions of websites with diverse purposes from blogging to social networking.  There are thousands of plugins and themes written for WordPress that can transform the website into pretty much anythingAnd now it can run with Amazon S3 without writing a line of code.

Yapixx taps into power of Amazon S3.  Amazon S3 is inexpensive, highly reliable, available and scalable storage service.  It got even less expensive recently and its usage is growing 2.5-2.9 times year-over-year.  Using Amazon S3 to store Yapixx data has the following benefits:

  •          Storage cost scales with usage, no upfront reservation is needed
  •          Storage consumption scales up and down with the amount of data stored
  •          Storage is extremely reliable and durable by Amazon S3 design
  •          Pictures are served by Amazon S3 directly, which makes Yapixx highly scalable
  •          No database backup and recovery is needed, now that Amazon S3 holds both for the website content stored in WordPress database and website’s media files

Yapixx demonstrates how easy it is to create web applications on top of Amazon S3.  Amazon S3 has been able to only power static websites; now S3 can power sophisticated dynamic web software such as WordPress.


Try out Yapixx

Here are the five easy steps to get Yapixx up and running:

  1. Sign up for an AWS account.
  2. Create an S3 bucket.
  3. Start EC2 instance using Yapixx AMI.
  4. Connect to the web application from a web browser.
  5. Enter the S3 data location and authentication information.

The full step-by-step guide for launching Yapixx is available here.

All done!  You’ve got a picture sharing site running on top of Amazon S3.

 

Get started with Yapixx today for FREE!  It may be the boost that you need to propel your creative ideas and turn them into the next $1B acquisition.

Take Your Own WordPress Site to Amazon S3

You can use Yapixx as a starting point to create your own beautiful WordPress site.  The plugins that turn WordPress into Yapixx, such as the wp2cloud plugin, the Yapixx theme, etc. are available under the GPL completely FREE.  Creating a new AMI with your own web application is a matter of two mouse clicks in the AWS management console:

Moreover, you may even get your web application hosted completely free in the Amazon cloud, if your AWS usage doesn’t exceed the AWS free tier limits.  This is a great way to get a new web application to production quickly, absolutely FREE!  And when your web application usage grows, you can easily move it to larger cloud instance or to your own hardware: the data is stored in Amazon S3 and can be accessed from anywhere.

 WordPress on Cloud

Launch your own WordPress site to the cloud today!  It’s easy and FREE, no writing code is required.  Start at http://www.oblaksoft.com/downloads.

Let us know what you think about Yapixx!  How can we further simplify the migration of websites to the cloud storage?

See also:

WordPress on S3: how it works.


PlanetMySQL Voting: Vote UP / Vote DOWN

Performance improvements for big INFORMATION_SCHEMA tables

Май 4th, 2012
A short while after I fixed the legacy bug that prevented temporary MyISAM tables from using the dynamic record format, I got an email from Davi Arnaut @ Twitter. It turned out that Twitter needed to fix the very same problem, but for the case when INFORMATION_SCHEMA temporary tables use MyISAM.

In short, INFORMATION_SCHEMA tables provide access to database metadata. Despite their name, they are more like views than tables: when you query them, relevant data is gathered from the dictionary and other server internals, not from tables. The gathered data is stored in a temporary table (memory or MyISAM depending on size) and then returned to the user.

The reason Davi emailed me was to let me know that he had further improved the fix for temporary MyISAM tables to also enable the use of dynamic record format for INFORMATION_SCHEMA tables. I usually don't have huge databases on my development box so the problem of querying metadata had gone unnoticed. But it turns out that Davi and his colleagues at Twitter do deal with massive amounts of data :-)

This was one of the queries that caused problems:

SELECT pool_id FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE limit 1;

Read more »

PlanetMySQL Voting: Vote UP / Vote DOWN

Interesting behavior of a MySQL benchmark on EC2

Май 3rd, 2012

I had to benchmark an EC2 instance to see whether a database could be safely moved to it. It is a good practice, which helps avoiding surprises when an instance or its storage are allocated in a noisy neighborhood, where the neighbors use so much resources that it affects the performance of our MySQL database. It is understandable that one can never get very reliable results on EC2, this is a shared environment after all, and that some fluctuations should be expected, however it is still good to know the numbers. I started my benchmarks and everything seemed fine at first, but then sometimes statistics I was getting started looking quite odd.

I was running the benchmarks on a High-CPU Extra Large Instance and couldn’t see any reliability in the results at all. I mean, in one moment I was getting poor throughput and horrible response times only to see it improve a lot a few minutes later. I ruled out a possibility that it could be some kind of problems with the storage performance causing this, so I started suspecting MySQL itself – perhaps some sort of contention. But no system statistics, nor any information from MySQL wanted to confirm that theory.

Finally, I went for oprofile and started it during one of the benchmarks and what I saw surprised me:


When oprofile was running MySQL performance nearly doubled. It was also reflected in the CPU utilization which increased accordingly and also got a lot more stable. After a while, I stopped oprofile and the performance dropped again.

At this point I am not sure how to explain this, however this was repeatable. Anyone?


PlanetMySQL Voting: Vote UP / Vote DOWN

The cost of improved security on a MySQL server

Май 1st, 2012

Security-Enhanced Linux or SELinux is a Linux kernel feature that provides a mechanism for supporting access control security policies. It enables a system administrator to create an extra set of rules that define allowed operations for programs even after the standard controls are checked. In other words, SELinux can help improving system security by restricting access of an application to only a few resources it actually needs, which makes it more difficult for an attacker to gain access to the entire system through exploiting any possible vulnerabilities in the application.

However as rarely anything in life is free, is there any price we have to pay to use SELinux on a MySQL server?

I ran a simple MySQL benchmark first with database working in a system with SELinux enabled (SELINUX=enforcing), and then also with the extra security layer entirely disabled (SELINUX=disabled).

The tests were performed on a 8-core system, running RedHat Enterprise Linux 6.2. The benchmark used Sysbench’s read-write OLTP test with data fully fitting into the InnoDB buffer pool.

Here are the results:

As it turned out, the difference in MySQL performance was negligible with small concurrency. However at eight threads MySQL lost approximately 20% of the throughput when SELinux was enabled. At sixteen threads it got much worse. Not only the difference continued to grow, but while on a clean system MySQL was able to maintain the throughput and even show some improvements, with the security policies applied the throughput started dropping quite rapidly.

The cost of keeping SELinux enabled seems rather high on servers that can become busy, although it does not mean this security feature should always be avoided. There is always a balance of what is more important.

Often a database server is buried under many layers of other things such firewalls, reverse proxies, web servers, application servers, or various kinds of middleware. In such cases one may not actually need to rely on that extra bit of security in that place. But in cases when there are one or two servers running both web service and database (think a typical WordPress site), it is unlikely that achieving the absolute top MySQL performance matters all that much, whereas keeping the server(s) safe does.

P.S. Yes, I am aware that running a WordPress installation or a similar software rarely focuses one’s concerns about security on the database server :-)


PlanetMySQL Voting: Vote UP / Vote DOWN

Meet The MySQL Experts Podcast: MySQL Thread Pool

Апрель 30th, 2012

In the latest episode of our “Meet The MySQL Experts” podcast, Mikael Ronstrom, senior MySQL Architect, explains us how the MySQL Thread Pool improves MySQL Scalability.

You can try out the MySQL Thread Pool via our MySQL Enterprise Edition Trial.

And…MySQL being of Nordic origin, Hyvää Vappua/Glada Vappen to all the Finns and Swedes among us!

Enjoy the podcast!


PlanetMySQL Voting: Vote UP / Vote DOWN

WebStor – new open source high performance API for Amazon S3

Апрель 20th, 2012

OblakSoft is pleased to announce the release of WebStor 1.0b.1.1– the library providing high-performance cloud storage access.

WebStor is used in ClouSE – the Cloud Storage Engine for MySQL.   ClouSE makes cloud storage to be a drop-in replacement for local storage.   The outmost efficient and reliable cloud storage access is one of the key requirements that make the solution viable.

We’ve got a lot of questions about how ClouSE achieves such a great performance working with cloud storage.  Cloud storage has a perception of being slow, but ClouSE works with cloud storage as fast as with local storage.  WebStor is one of three pillars for high-performance cloud storage access (compression and caching are the other two).

In our benchmarks we were able to achieve up to 80+ MB/s transfer rate with Amazon S3.  While ClouSE needs much, much less than that, thanks to compression and caching, when push comes to shove, WebStor is up for the job.

Here is the WebStor performance benchmark chart for transferring data from / to Amazon S3:


The chart shows how the transfer rate was growing, as the number of parallel operations was increasing from 1 to 64.  It started with ~8 MB/sec with one operation running at a time, and grew all the way to ~80 MB/sec with 64 parallel operations.  The benchmark was run in the Amazon US-standard region.  The object size used in the benchmark was 1 MB.   The benchmark source code is included along with the WebStor library.

WebStor has the following features:

-          Supports Amazon S3 and Eucalyptus Walrus.  Other cloud storage provides may be added in the future.

-          Runs on Linux and Microsoft Windows.  Should be easily portable to Linux-like platforms.

-          Supports parallel put / get / del operations which allow achieving high throughput.

-          Supports SSL and plain-text HTTP.

-          Supports HTTP proxy.

-          Supports Amazon S3 multi-part uploads.

-          Provides C++ API.  APIs for other programming languages may be added in the future.

WebStor source code is available under the Apache 2.0 license absolutely FREE.  Get your own copy now from at http://www.oblaksoft.com/downloads.


PlanetMySQL Voting: Vote UP / Vote DOWN

IOUG Podcast 18-APR-2012

Апрель 19th, 2012
For the week of April 18th, 2012: Oracle Announces It’s First Sponsored MySQL Conference A New Development Milestone Release of MySQL 5.6 is now available IOUG’s Real World Performance Tour Returns to California this Month IOUG’s Plug-In to Vegas! adds … Continue reading
PlanetMySQL Voting: Vote UP / Vote DOWN

Analyzing I/O performance

Апрель 19th, 2012

There are probably thousands of articles on the Internet about disk statistics in Linux, what various columns mean, how accurate the information is, and so on. I decided to attack the problem from a little bit more practical side. Hopefully this will be just the first of many future posts on identifying various I/O related performance problems on a MySQL server.

Linux exposes disk statistics through /proc/diskstats. However the contents of this file isn’t something anyone can understand quickly. It needs a tool to transform the information into something human readable. A tool that is available for any Linux distribution is called iostat and comes with sysstat package.

How to access and read I/O statistics

Usually you want to call iostat one way:

iostat -xkd <interval> <block device>

The interval should typically be one second as it is the base unit for many things, but also because it gives the best level of detail. With longer intervals some of it could be averaged out. This is a typical example of where any analysis begins:

bash-4.2 # iostat -xkd 1 /dev/drbd0

[..]

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
          22.35    0.12    9.61    3.12    0.00   64.79

Device: rrqm/s   wrqm/s     r/s     w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await  svctm  %util
drbd0     0.00     0.00   16.00   79.00   192.00  1408.00    16.84     2.66   27.96   3.75  35.60

Note: Make sure to ignore the first round of output iostat produces as it shows the statistics concerning the time since the system was booted rather than only a current period.

What does it say? In interval of the specified length, /dev/drbd0 device was doing 16 reads per second (r/s) and 79 writes per second (w/s). The average I/O request size was roughly 8.5 kilobytes (avgrq-sz * 512 bytes), while the average wait time 27.96 milliseconds (await).

How to use the information?

Out of all these metrics, one is definitely more important than others. The average wait time says how much time an average I/O request spent both waiting in queue and executing, which you should read as how long my database may had to wait on a disk access. It’s the response time. This is only an average, so by definition not a very accurate information, however in most cases it tells enough to recognize a potential problem. For example, nearly thirty milliseconds could be a lot if one expects queries to return within only a few or less. The queries that find information buffered in memory may still meet the expectations, however the disk-bound ones could very well become many times slower.

It’s important to relate the response time to the capabilities of the storage on which it is measured. You should not expect the same range of values from an EBS volume as from a locally attached RAID array.

Newer versions of iostat provide even more useful information by splitting await into two separate columns: one for reads (r_await) and one for writes (w_await). This way you can see how each type of activity contributes to the global average, but more importantly, it helps to understand more precisely where the problems may be. Unfortunately this version is not available on many Linux distributions, at least not by default.

But there is another way to get the extra insight. A script called pt-diskstats from Percona Toolkit reads information from /proc/diskstats directly and generates an output that includes these more detailed statistics.

bash-4.2 # pt-diskstats -d 'drbd0$' -c 'rd_s|rd_rt|rd_cnc|wr_s|wr_rt|wr_cnc'

#ts device   rd_s rd_cnc   rd_rt    wr_s wr_cnc   wr_rt
{1} drbd0     7.9    0.0     1.0    62.2    0.9    15.1
{1} drbd0     4.6    0.0     1.1    57.9    1.4    24.2
[..]

Note: The example uses pt-diskstats 1.0. The current version is 2.1 and implements a different naming scheme for the command line parameters, however I discovered the newer versions sometimes used to produce incorrect results and therefore I postponed my upgrade until later time.

The output is a bit different from iostat, but it shows the same information. rd_rt and wr_rt are response times of the respective I/O request types and they carry the same information as await.

The next step would be looking at how many I/O operations happen every second. If the sum of r/s and w/s is close to the storage theoretical capacity, it can very well explain the elevated await times. In order words, this could mean the system is running out of the I/O capacity. Being able to identify such situation is important as it can save you from investigating a performance problem when its direct cause is just in front of your eyes. This is why you should always benchmark a storage before it is put to use, although please remember that you need to benchmark for IOPS rather than for throughput.

Afterwards it may also be worth checking at how much data is being pushed in or out. A very long sequential read or write may need significantly more time compared to a much shorter one, so a larger avgrq-sz could explain the extended waits. Until you learn what values make sense and which look odd, this is where a good graphing system comes in handy as it would enable you to compare the historical sizes to current ones. In practice, however, this metric is mostly useful in discovering problems that are not coming from database itself as the only sequential I/O it can be doing are read-aheads and they aren’t very common. A running backup, some runaway rsync – these are more typical examples of things that could noticeably affect it. Related values are shown in rkB/s (or rsec/s) and wkB/s (or wsec/s), although they show the accumulated size of reads or writes respectively rather than just per-request average.

One last item is %util. It shows what percentage of the interval the block device was busy serving requests. People often tend jump to conclusions about a storage performance only by looking at this number, because it is easy. I almost never look at it. The value here can sometimes be very misleading as Linux does not recognize that a block device it sees, may be a logical RAID volume that down below consists of multiple physical disks. Therefore any parallel I/O execution will never be reflected properly in this metric, so while it can be used as a hint in certain cases (i.e. when it is close to 100%), you should always verify the actual utilization through other metrics. The simplest way is calculating the real value through the following formula:

concurrency = (r/s + w/s) * (svctm / 1000)
%util = concurrency * 100%

There are two important pieces of information in here. One is that request concurrency can be calculated. Knowing the value may become important when figuring out problems with I/O requests serialization which occurs in applications (e.g. MySQL working as replication slave where queries execute in a single thread). Or it may show that the concurrency is higher than the number of disks in an array, which would imply the storage cannot keep servicing incoming requests. And the second is that utilization can in fact be higher than 100% with a storage built from multiple disks, which is what iostat would never show.

Working with the information

In the final section, let’s go through an example.

Good graphs can be useful. I like to graph the iostat or pt-diskstats output over longer periods, a few minutes at least, because it allows seeing patterns and spotting problems without even bothering yourself with looking at numbers until there is actually a reason.

What we can see is that write response times are quite high and periodically spike to 200 milliseconds or even higher, while at the same time reads seem to be doing well. There appears to be no unusual activity around the spikes, though. The I/O utilization remains in a reasonable range of 100 – 150 IOPS, which is something even a single disk should handle without delays.

With locally attached, ordinary spinning disks the response times should hardly ever cross the ten millisecond threshold. That limit is sufficient for most disks that are commonly installed in database servers. Assuming a RAID array with some write-back caching, write response time shouldn’t even be anywhere near that, because everything should be going straight to a much faster storage – the cache memory. But for some reason we see 15ms or more.

The Throughput and Requests Size graph doesn’t add anything interesting. Nothing there can be correlated with the increased response times.

However when we zoom in on one of the spikes in the I/O Utilization and Performance graph, we can make one interesting observation. Reads not only work without any issues, but seem completely unaffected by the problem (blue and red lines on the graph). Why?

We should focus on the block device for a moment. The statistics were pulled from a DRBD volume, which holds the MySQL data files. DRBD is a block device driver working on top of an another block device, which intercepts writes and synchronously sends modified blocks to another system. Synchronously means that it blocks an I/O request until the write completes in both locations. From there we can quickly conclude that reads are fine, because they always come from a locally attached disk. Writes are slower, because they need to be synchronized over the network to the secondary storage. So perhaps it is the other server that isn’t performing well, or maybe there are problems on the network layer, or maybe DRBD has been poorly configured… Of course, at this point all we have are guesses, but together with the data collected, these guesses set a pretty good direction for further investigation.


PlanetMySQL Voting: Vote UP / Vote DOWN