joshua655 / v8cgi

Automatically exported from code.google.com/p/v8cgi
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

v8cgi + mysql painfully slow ! #82

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
var MYSQL=require("mysql").MYSQL;
var db=new MYSQL.connect ("...","...","....");
var r=db.query ("select * from test");
// where table test have 12 record of 5 fields.

connection take 2 secondes !!!

is-it possible to "keep connected" ?
(nginx+spawn-fcgi+v8cgi)

thanks

Original issue reported on code.google.com by oolmf...@gmail.com on 13 Jan 2011 at 4:59

GoogleCodeExporter commented 9 years ago
I cannot reproduce this low speed, so you need to perform some more detailed 
observations:

1) what OS, v8cgi, mysql version?
2) the mentioned 2 second delay is caused by the "connect()" call, or by the 
"query" call?
3) is the same behavior visible when using 
  3a) command-line mysql client, 
  3b) php mysql library,
  3c) v8cgi used on command-line (no webserver) ?

Original comment by ondrej.zara on 14 Jan 2011 at 10:02

GoogleCodeExporter commented 9 years ago
pc = amdx4 4go ram
Os = virtualbox (3.2)
host = w7 x64 integral
guest = debian x64 (lenny) 1024ram 

mysql = v5 x64 under host (W7x64)
v8cgi = 0.9.0 myself compiled (scons arch=x64 ....) under debian guest

2 second for "connect()"
from spawn-fcgi+nginx or command-line.

I haven't this "problem" with php+nginx or mysql client

do you get fastest "mysql.connect()" under debian ?

Original comment by oolmf...@gmail.com on 16 Jan 2011 at 12:30

GoogleCodeExporter commented 9 years ago
Yeah, my experience is relatively fast. If you are able to compile v8cgi 
yourself, perhaps you can also do some minor debugging stuff? 

The "connect()" code is relatively short, located in src/lib/mysql/mysql.cc; in 
the JS_METHOD(_connect). Maybe you can insert some printf() statements printing 
out the current time in order to see what call takes 2 seconds...

Original comment by ondrej.zara on 16 Jan 2011 at 10:24