pear on heavy loaded sites

From: Date: Fri, 15 Nov 2002 12:52:40 +0000
Subject: pear on heavy loaded sites
Groups: php.pear.dev php.pear.general 
Request: Send a blank email to pear-dev+get-10838@lists.php.net to get a copy of this message
hi, i find really intresting pear project and i've been subscribed to pear lists since few days. approaching to pear, i find it really interesting, but i would know if exists any documentation or previous messages about pear objects working on heavy loaded sites, especially about db objects working with different db servers... this is my experience. i have a db server with mysql-max, recompiled and optimized on our needs and several web servers delivering about 1 million daily page views. say web server as "A" and db server as "B". writing my own php classes, providing db connection handling, i find out pretty things when reading lot of data from several scripts of my site. i used some "hand-made" class providing db connection, just like some DB/pear-like functionality such as query(), fetch(), etc. my aim was also to abstracts results set store method. i try to explain... when using such class, database connection works differently if you change results fetch operations, storing results directly into class or not. i tried two different ways: 1. let developer (who writes directly script codes) manage directly fetch() function, deciding when reading one rows and another and so on. this means, if developer do some time-spending operations during a fetch-cicle, db connection wait with result set stored in B (mysql buffer). 2. fetch result set directly into a class object, fetching internally all result set in an array-object. when developer starts fetch cicle, results are stored internally in a class object, so mysql connection doesn't required to be persistent and let buffers free. at least, results are stored internally by php db buffer (?), but i prefer A goin' slow, than B. i find out that the 2nd way is better when you have many db connections, since in the 1st case B waits for new request until another fetch() is done, while in the 2nd case db class fetches all rows one time and store them into A, waiting for script reading and cut off db waiting. further, this is why, with heavy-loaded db server, i prefer not use persistent connections. hopefully someone will enjoy my suggestions/questions... bye, stain. ps: sorry for crossposting, but i suppose there should be more interested readers in pear-dev lists about such things... -- "If there is any, error is human"

« previous php.pear.dev (#10838) next »