vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Is it better to log in or out for each query or log in and stay logged in for all queries? It would be easier for me to log in and out for each query but I'm worried that this might cause excessive overhead in the future. Thanks, Jon |
| |||
| > Is it better to log in or out for each query or log in and stay logged in > for all queries? Under windows: definitely not! There is an issue that ports remain open for a couple of minutes before they can be reused again. So you can run out of free ports... In general: I never even tried it, but I suspect it slows things down a bit. On the other hand, logging in into a mysql database is not that slow. > It would be easier for me to log in and out for each query but I'm worried > that this might cause excessive overhead in the future. Why? It is not that difficult to keep connection or connection wrapping objects in a variable. And as a programmer you are responsible to dispose of any resources you open. Even if PHP is a bit forgiving in this respect. Best regards. -- Willem Bogaerts Application smith Kratz B.V. http://www.kratz.nl/ |
| |||
| Jon Slaughter wrote: > Is it better to log in or out for each query or log in and stay logged in > for all queries? > > It would be easier for me to log in and out for each query but I'm worried > that this might cause excessive overhead in the future. > > Thanks, > Jon > > there is no problem with staying logged on if your design and setup allows that. however, each time you log out and back in, understand that a thread is destroyed (hopefully explicitly by you but potentially implicitly by the server) and a new one is created. try to create some metrics and base your method on those metrics. mysql can and does a good job of either of these methods. -- lark -- hamzee@sbcdeglobalspam.net To reply to me directly, delete "despam". |
| |||
| *snip* > try to create some metrics and base your method on those metrics. mysql > can and does a good job of either of these methods. mysql might, but the other layers might not. I believe JDBC has substantial overhead obtaining a connection when not using connection pooling, but I may be mistaken. |
| ||||
| Jon Slaughter wrote: > Is it better to log in or out for each query or log in and stay logged in > for all queries? > > It would be easier for me to log in and out for each query but I'm worried > that this might cause excessive overhead in the future. > > Thanks, > Jon > > Jon, If you're talking web access, on a single page it's definitely better to login before your first query and no log out until after your last query (within the same page, of course). For non-web-based languages, it all depends on just how often you need the info and what modules require it. Generally I only open one connection and close it between user interfaces. Just never keep a connection open while the user is contemplating his navel. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |