RE: [PHP] MySQL Scalability, part 2

From: Date: Mon, 25 Oct 2004 03:10:32 +0000
Subject: RE: [PHP] MySQL Scalability, part 2
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-200214@lists.php.net to get a copy of this message
-----Original Message----- From: Kevin Grigorenko [mailto:kevin@myplaceonline.com] Sent: Monday, October 25, 2004 8:13 AM To: php-general@lists.php.net Subject: Re: [PHP] MySQL Scalability, part 2 "Zareef Ahmed" <za@lmpx.com> wrote in message news:001d01c4ba3b$a9e91c80$0100a8c0@vsserver... > -----Original Message----- > From: Kevin Grigorenko [mailto:kevin@myplaceonline.com] > Sent: Monday, October 25, 2004 12:36 AM > To: php-general@lists.php.net > Subject: [PHP] MySQL Scalability, part 2 > > Hi, > > First, sorry for posting an attachment. Second, I fixed my problem to > use files, but I just had a general question: > > Is it really scalable to use MySQL on every page hit as compared to > writing to files? Is it true that it only has a certain number of > connections it > can open at a time (20-30?), and the contention is larger? > > [>>] Yes mysql is much faster than file writing. And you can open > multiple connection to it. >What is this statement based on? I'm absolutely not questioning you, I am just skeptical (if you have any websites or >>>performance benchmarks, please provide). It's hard for me to imagine that a file system access (let alone appending one >line to the end of a file) is slower than a MySQL execution. Even if we assume that MySQL does everything in memory, here >are just some of the things that have to happen: >1. A MySQL connection may be opened. Perhaps there is connection pooling, and this isn't too bad, just finds a reference >to an already open MySQL connection. Performance hit ~ 0 2. mysql_query is executed, which first must go through the PHP >library, then connect to a socket (perhaps on another server, but we'll assume on the same server for now). Performance >hit ~ negligible if the mysql daemon is on the same server 3. The mysql daemon then has to process this request along with >whatever load is already on the daemon, then needs to get locks on the table to insert into it. Performance hit ~ could be >a lot, I doubt MySQL is faster at locking than flock() 4. MySQL has to probably do a lot of in memory operations and then >send the result back over the socket. >But if you have some webpages that prove otherwise, i will be VERY GLAD to see them, because mysql sure makes everything >much easier. I just can't see it yet based on such a simple statement as above. Mysql just set a world record http://mysql.bigbiz.com/news-and-events/press-release/release_2004_27.ht ml Yes your concern are right there may be some other or lenghty task in processing data via mysql than simply append a line to file. But above all it is over all usablity and performance which matter. But your idea about a benchmark is intresting .....whenever I will find one I will inform you for sure ;) But I think it will be for academic use only. Zareef Ahmed > > Visit > http://dev.mysql.com/doc/mysql/en/Too_many_connections.html > > Thanks, > Kevin > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > > ---------------------------------------------------------------------- > -- > -- > Zareef Ahmed :: A PHP develoepr in Delhi ( India ) > Homepage :: http://www.zasaifi.com > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.782 / Virus Database: 528 - Release Date: 10/22/2004 > Thank you, Kevin Grigorenko --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.782 / Virus Database: 528 - Release Date: 10/22/2004

« previous php.general (#200214) next »