I am concerned about # of concurrent binary connections to orientdb, 
especially in the sense of using orientdb as the primary data provider to a 
web app with lots of concurrent users. We primarily use standalone nodeJS 
sensors to write data via orientJS and php on the web server to read data 
via phpOrient. 

In watching db connections very closely, a few things are immediately 
apparent. First, every orientJS client opens 2 binary connections to 
orientdb. One connection does nothing and the other handles all the work 
but if I kill one it reestablishes both. Perhaps this is a code or 
configuration error but I have no way to know.

Second, even when I connect to orientdb remotely via the orientdb console 
application, 2 binary connections appear on the server.

Third, every ajax request my web app receives opens 2 new binary 
connections to orientdb. Whatever is causing 2 connections via orientJS is 
also causing 2 connections via phpOrient. One visitor page view may 
initiate 8 ajax requests which in turn open 16 binary connections to 
orientdb. Very alarming.

The good news is phpOrient is pretty good about closing all the binary 
connections it opens. Conversely, for whatever reason my sensors that write 
data to orientdb via NodeJS/orientJS are always leaving connections open. I 
think there may be legitimate network outages/congestion happening but it's 
alarming to see 9 open connections from a sensor ip address and know that 
only 2 are active (really only one but that duplicate problem again...) and 
7 are zombies. OrientDB seems to leave zombie binary connections open 
forever and eventually the db connection pool fills up and doesn't let me 
back in, even to shutdown and restart the orientdb server gracefully 
without a kill -9.

Questions for the OrientDB support team or you more experienced users:

a) Are other people seeing 2 binary connections per client or is this 
situation strictly limited to my environment/configuration?

b) Given the high number of zombie connections, the db.pool.max value I 
configure in config/orient-server-config.xml becomes very important. I 
think the default is 50. What would you say is a higher, but still safe 
value? 500? 5,000? My dedicated orientdb server has 32GB RAM and a quad 
core CPU, with 14Gb dedicated to heap and roughly 14Gb dedicated to 
diskCache. How many binary connections should the server be able to handle?

c) I have toyed with the idea of moving away from phpOrient and orientJS 
and simply making http rest calls to orientdb because at least those 
connections get closed quickly and consistently compared with binary 
connections. Is this a good idea or bad idea? I don't know how much of a 
performance gain I get by using binary connections vs an http connection 
with basic auth for every query.

d) Is there a simple way to make orientdb kill zombie binary connections 
that I haven't stumbled upon yet? My crude workaround is using a cron job 
to http rest query all open connections and then http rest kill connections 
one by one.

Any other insights you can provide would be greatly appreciated.

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to