On 15 Mar 2001 17:56:18 -0800, Randy Johnson <[EMAIL PROTECTED]> wrote:
>I have a question. can a 1 php script access a mysql database more than 10
>times a second.... it's a simple updated statement? if it can how many
>times do you think it can access the database in a second?
Sure, depending on the hardware, database and server configuration. On my
desktop with a small database which fits entirely in RAM, MySQL doesn't even
blink at a few thousand updates in a second. If you were working with a large
database which is being read and updated by many processes at the same time,
performance won't be as good.
Tips:
- Make sure you have enough RAM. An easy way to get high performance is
to make sure the operating system can cache everything and MySQL has
all the space it wants for buffers.
- Try to avoid situations with lots of SELECT and UPDATE / INSERT
statements being executed at the same time. MyISAM tables allow
simultaneous SELECT and INSERT statements, which can help a lot.
- If the data doesn't need to be kept permanently (e.g. session
variables), use the HEAP table type. HEAP tables are kept entirely in
memory and are insanely fast. This could also help with busy tables
getting updated frequently - have a HEAP table which is periodically
refreshed using the INSERT INTO ... SELECT syntax so that you get a
large SELECT or INSERT statement hitting a table ever 30 seconds
instead of every time someone requests a page.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]