Forum Moderators: phranque

Message Too Old, No Replies

Inserting data from web POST directly into database

post, mysql, web, insert, bypass, c

         

guyravine

6:40 am on Feb 22, 2006 (gmt 0)



I am trying to optimize the speed of inserting web POST requests to the database by bypassing the programming langauge altogether and performing the insertion from the webserver to mysql, or using a very fast c procedure to insert the data to the database. My system is very simple: it just receives POST data from the web and inserts them into the database. Right now I'm using PHP to simply perform an insert statement on the POST data to put it into the database. But I was wondering if there could possibly be a way to bypass PHP (or any programming language) altogether and just pass the POST data directly from the webserver (Apache or TUX) into the database?

Any ideas would be appreciated.

zCat

8:44 am on Feb 22, 2006 (gmt 0)

10+ Year Member



At some point you'll need some programming language form the interaction, even if it's a custom C module for Apache.

Personally I would expect most of the overhead from an INSERT operation would be from the database itself, with the time directly attributable to the responsible programming language being negligible. The INSERT operation is probably where you will be able to optimize the most.

If you're using MySQL with the default MyISAM tables, you should be aware these can be very slow on INSERTs, especially if you have indexes.