Export to GitHub

v8cgi - issue #82

v8cgi + mysql painfully slow !


Posted on Jan 13, 2011 by Helpful Cat

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

Comment #1

Posted on Jan 14, 2011 by Happy Giraffe

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) ?

Comment #2

Posted on Jan 16, 2011 by Helpful Cat

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 ?

Comment #3

Posted on Jan 16, 2011 by Happy Giraffe

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...

Status: New

Labels:
Type-Defect Priority-Medium