Lazy Db Connection

Hi! I develop website about high traffic. At last hosting was down becouse has to many connections to database (mysql). Most of all requests fetch data from memcached and connecting to db is not necessery. Is any way to connect to database "on demand" but not always request?

It is lazy loaded by default. all application components work this way - thay are instantiated only on first access. You can make them loaded by default adding them to ‘preload’ in configuration.

You should check if there is realy no database related code executed in your scenarios (user privileges, dbsession, or maybe even instantiating activerecord model - it fetches table structure from database)

Thanks for your answer redguy. I didn’t know that.