Peter Zaitsev
 

This - my blog. You can leave comments to records.

Add to Favorites Send me an e-mail
Interesting websites
Visitors
Calendar
<
May 2012
>
MTWTFSS
 123456
78910111213
14151617181920
21222324252627
28293031
Subscription
E-mail: 
Top commentators
peterz Peter Zaitsev
Comments: 1
Other sites
arie Arie E
joroshterev Georgi Sotirov
broxibear broxi bear
itnews ITNews Admin
clavier Clavier
Most commented entries
Тест
Comments: 2

Get RSS


Entries
 Leaving MySQL, MySQL Consulting
Posted by:peterz Peter Zaitsev 2125 days ago 05.08.2006 00:28:00

As I already wrote on my new blog I've now left MySQL and will pe starting my own company to provide MySQL Performance Consulting services.

So if you need any help with MySQL or have any friends which need one let me know.

I also will be working on few web projects and opensource projects. I'll keep you posted.

Comments: 0   Views: 1565   Group: Общие  

 MySQL Performance blog updates
Posted by:peterz Peter Zaitsev 2191 days ago 30.05.2006 20:37:00

My blog link at PlanetMySQL.org is still not updated so here is list of posts me and Vadim are written during last couple of weeks.

Group Commit and XA Some more benchmark results for MySQL 5.0 performance regression because of broken group commit.

Speedup your LAMP stack with LigHTTPD The article is about Optimization of Web Server part in LAMP stack in general and how you can use lighttpd to speed things up in particular.

How Web Services world affect LAMP Stack Article discusses some things which become different with Web Services application. Kind of followup to previous post.

MyISAM mmap feature (5.1) Vadim writes about mmap support for MyISAM which he has implemented for MySQL 5.1

Jeremy Cole on MySQL Replication
This article comments on post by Jeremy Cole discussing reliable replication options.

MySQL SpecJAppServer2004 results Announcing MySQL official results in SpecJAppServer benchmark published by Sun with out help.

INSERT ON DUPLICATE KEY UPDATE and summary counters. Article about Using INSERT ON DUPLICATE KEY UPDATE feature to speed up summary tables creation

Join Performance of MyISAM and Innodb This article compares MyISAM and Innodb storage engines in join speed for CPU bound case.

InnoDB memory usage Details about Innodb memory allocation. Something you need to know planing MySQL server memory usage.

Comments: 0   Views: 1388   Group: Общие  

 MySQL Performance articles update
Posted by:peterz Peter Zaitsev 2203 days ago 18.05.2006 23:13:00

It looks like my request to update PlanetMySQL.org to use new blog is not yet handled so let me post here links to the fresh articles I've written recently:

MySQL Server Memory Usage This artice speaks about MySQL Server Memory usage, how to estimate it and control it.

To Pack or Not to Pack - MyISAM Key Compression This article speaks about benefits and draw back about MyISAM packed keys.

Comments: 0   Views: 2296   Group: Общие  

 MySQL stuff moves to new address
Posted by:peterz Peter Zaitsev 2208 days ago 13.05.2006 22:42:00

Hi,

I decided to start blogging about MySQL stuff in the different blog http://www.mysqlperformanceblog.com This will give me more control allowing to publish files on the same web site as well as track visitors stuff. I will be still updating this one every so often with my personal records.

For LiveJournal users - I've created syndication account "mysqlperf" which syndicates my new blog, so you can just add it to your friends list if you want to follow new blog.

PlanetMySQL.org is not updated yet to include new blog. I hope this will happen soon.

Lets hope I'll have time to update my new blog more frequently. And your comments surely would be good motivator :)

Comments: 0   Views: 1132   Group: Общие  

 MySQL: Using giant number of connections
Posted by:peterz Peter Zaitsev 2240 days ago 11.04.2006 23:00:00

Every so often I need to reply the question, what is the best way to use 10.000 connections with MySQL (you can select your favorite big number here)
Well. The good answer is your better not.

First let see where this requirement typically comes from ? Most commonly it is something like we have 40 apache boxes each having 200 children with persistent connections which gives us 8000. Well... This brings me to two questions - do you really need persistent connections and do you really need 200 apache children ?

Persistent connections will give you decent performance benefit only in one case - if there are few database queries to create the page and if database load is large response time contributor. In modern rather complex applications it is rarely the case. This is one of examples why persistent connections were disabled in "MySQLi" for PHP. Java applications are better in this sense as they typically use connection pooling rather than persistent connection which needs far less connections and much less efficient.

Now about 200 apache children on the box ? Why so many of them are required. In some cases it is good justified but in most it is simply poor configuration of Web part. 90% of these 200 children will be spoonfeeding slow clients, while keeping their large chunk of memory allocated by mod_php
mod_perl or whatever you use part. One thing you can do to solve this problem is to place lightweight proxy in front which can spoonfeed your clients, do keepalive and even cache if something can be cached. You can use apache module for this purpose while I'd like something more lightweight, ie lighttpd. Important requirement here is not using process/thread per connection and based on events rather than select() or pool() in handling network as these are slow with large number of connections. By using these you can have 10.000 connections or more per box with small number of apache children. The other option is to use lingerd, which I did not try however. Finally the most radical option is to use fast-cgi interface which allows you to use much wider selection of web servers.

So if 200 processes is a lot how many is enough ? Well it depends on the application. In certain cases, for example if application uses Web Services internally or some other remote network calls. In this case you simply need a lot of processes running to get the performance you need. In most common case however if load is CPU bound and does local database calls you can do better with much smaller value.

Each "device" have the optimal number of requests which it can handle at the time. for CPU signle running thread per core is optimal. For hard drives
it may be few requests per drive (to allow scheduling) but if you get too many you would get your sequential scans interrupted by random IO etc.
Also you should count memory and CPU cache - the more concurrent processes are running the smaller portion of CPU cache and OS disk cache each of them get, not to mention they use memory themselves which reduce OS cache and even could cause swapping. The optimal number of proessess depends on the load, if it is CPU bound you would watch number of running threads more, if it is IO bound you would watch number of outstanding requests.
As a quick and dirty I usually use (NumCPUs+NumDisks)*2 value. Depending on the application, OS, hardware and MySQL bugs it may be more or less than that.

The curious thing about this number is - it is kind of universal, even if it is not always 42. If you look at "localy running threads", meaning threads running on local CPUs or being blocked on local resources you can use this value - if it is Web server, application server or database server. If process is waits on network it is not local resource so you likely want to have many of these.

So how many ? I would start guessing from 20-40 is the optimal number of active threads on the Web/Application server. Then it comes to MySQL
I'd see even less than that in "threads_running" Most typically values below 10 are optimal for CPU bound workload and below 30 for IO bound.
It depends on hardware and workload of course.

What are the problems with many connections on MySQL side ?
- Waste of memory. Each connection requires certain resources and might not give away all of them even if it is "sleeping"
- Load On OS - Operation System rarely enjoys managing 1000s of threads TCP/IP connections
- Many Running threads - thrashing of CPU cache and So waste of CPU resources.
- Many Running threads - mutex ping-pong. Especailly bad for Innodb tables
- Small annoyances as hard to deal with "show processlist", broken "SHOW INNODB STATUS"

Comments: 0   Views: 451   Group: Общие  

 MySQL: Preparing for MySQL Users Conference
Posted by:peterz Peter Zaitsev 2249 days ago 03.04.2006 00:01:00

MySQL Users Conference 2006 is now in close proximity and I'm working hard preparing my presentations.
I've got 3 ones this year. All should be very interesting one but challenging to prepare.


First one is MySQL Performance Optimization Tutorial, which I'm doing with Tobias. It is kind of sounding similar to what I've been doing last year
but it is a lot different in the content. Frankly speaking we did not recycle any of the old stuff and just wrote everything from scratch. To learn from
previous year mistakes we now have it more condensed so we can cover everything in short 3 hours, as well as keeping it much more practical. Based on My and Tobiases experience of performance optimization of real application we kind of provide how to or insight on how we work, what exactly do we do, why and how we do it. For particular application there are of course much more specific tricks which can be played but at least we're sharing most generic, simple and powerful ones.

Second one is presentation about MySQL 5.0 to 4.1 Performance. This one required running a lot of benchmarks to be able to quantify performance improvements of various MySQL 5.0 optimizations and new features, as well as performance regression in the cases it went slower. Yes we're not going to hide anything - there are many performance improvements and new features, but these had to be paid for by reduced performance in certain other cases.

Third one is "MySQL Performance Landscape" - This one is the most time consuming to prepare. I and members of MySQL High Performance Group run well over the hundred benchmark to investigate MySQL Performance with different workloads on different platforms. How well MySQL scales for Multiple CPUs, Which operation system is better, does Dual Core really rule etc, we'll try to have many of such questions answered.

Comments: 0   Views: 166   Group: Общие  

 MySQL: Hardware RAID5 vs RAID10 analyses
Posted by:peterz Peter Zaitsev 2363 days ago 10.12.2005 01:48:00

Recently I had a chance to revisit question of RAID5 vs RAID10 performance for MySQL OLTP workloads (Random IO). The previous set of benchmarks
I've done for MySQL Users Conference almost two years ago were done on RH AS 3 and 8 Drive SATA 7200 Drives connected via 3Ware 8500 or something.
In that configuration RAID5 looked horrible compared to RAID10 showing absolutely terrible performance.

This time I've tested on Dell PowerEdge 2850 with 6 10000RPM SCSI drives connected to embedded RAID (LSI MegaRaid) with 256MB of cache and battery backed up. Operation system was CentOS 4.2 x86_64, ext3 file system.

(Read more)

Comments: 0   Views: 378   Group: Общие  

 MySQL 5.0 - time to upgrade ?
Posted by:peterz Peter Zaitsev 2401 days ago 01.11.2005 22:18:00

Now as MySQL 5.0 is finally released as GA, or stable I guess many of your are asking yourself if it is the time to upgrade.
Let me express my opinion on this matter.

(Read more)

Comments: 0   Views: 128   Group: Общие  

 Тест
Posted by:peterz Peter Zaitsev 2479 days ago 15.08.2005 17:50:37

тестик тест

Comments: 2   Views: 9477   Group: Общие  

 MySQL: Finally having a way to fall back without transaction loss.
Posted by:peterz Peter Zaitsev 2724 days ago 14.12.2004 05:28:00

For a long while the fact was - MySQL has asynchronous replication, so if you will be falling back to the Slave you will be
loosing some of latest transactions, this was perhaps the only practical reason to recommend active-passive clustering instead of replication for applications needing such insurance. Happily with recent MySQL 4.1 version there is a way to
solve this problem

(Read more)

Comments: 0   Views: 191   Group: Общие  

 Software Patents
Posted by:peterz Peter Zaitsev 2773 days ago 25.10.2004 18:33:00

I run into pretty interested web site yesterday http://www.nosoftwarepatents.com/ It has very interesting thoughts about software patents,
for example http://webshop.ffii.org/ looks like great example of how trivial and obvios things could be actually patented.

I also really like their comparison of software creation process to Art/Music/Movies creation. It would really be strange to patent of mixing of
bass guitar and piano in the music composition, but similar things can be patented in software industry.

It is strange how legal system in Europe could come to this point, but it is even more strange the things are already this way in US.

The first thought which comes is - how can ever small shop start to develop software ? It is almost certain some patients will be voilated
and so the only hope left is big pattient holders would not notice you until you start to hurt them. The only question is when this practically
starts to heppen.

Comments: 0   Views: 212   Group: Общие  

 Leaky Leaky Linux
Posted by:peterz Peter Zaitsev 2813 days ago 16.09.2004 00:19:00

How could Linux desktop applications be be so leaky ? Is it what everyone restarts their system
every day ? After 11 day uptime on my laptop I have "X" process taking 250MB, kdeinit is over 100MB, Firefox over 350M, even though I have just 8 small pages open, java_vm is taking over 200MB
even though I used it from web browser few days ago. In total I have 550MB of swap space used while
having 768MB of Ram.

This is all with SuSE Linux 9.1 but I do not think other distributions are significantly different
in this respect.

Comments: 0   Views: 306   Group: Общие  

 Danger of positive attitude
Posted by:peterz Peter Zaitsev 2823 days ago 06.09.2004 03:24:00

Yesterday we went to Reptile Zoo and among other things my son had a chance to pet various snakes,
put them around their neck and do other fun stuff.

Today we went to the park and run into wild snake taking sun bath on the trail. Instead of being scared and run away he asked me if he can touch it as pet snakes yesterday :)

Comments: 0   Views: 280   Group: Общие  

 DVD Recordable Standards
Posted by:peterz Peter Zaitsev 2834 days ago 26.08.2004 06:31:00

Today I tried to use by laptop Recordable Drive for backup. Unfortunately it did not work.
As It turned out I bought DVD+R blank DVDs while I have DVD-R drive.

Well I heard there are different recordable DVD standards some 5 years ago but I hoped they already figured out to make things compatible with each other. At least I hoped blank disks would be compatible, but it does not looks to be the same.

Anyway it was very poor choice to create 2 incompatible standads which have so similar name and which have disks looking exactly the same.

Good thing is this is sort of mistake you normally do only once :)

Comments: 0   Views: 1261   Group: Общие  

Who is active on the site?
Anonymous: 5, Registered: 0 (?)
Abuse | Hosted by MyLivePage | | © Kolobok smiles, Aiwan