jywarren / mapknitter

Use Public Lab's MapKnitter to turn your aerial images into projected maps for print and web
http://mapknitter.org
GNU General Public License v3.0
45 stars 0 forks source link

periodic downtime #151

Closed jywarren closed 9 years ago

jywarren commented 10 years ago

Having resolved the nearby_maps issue, we continue to chase downtime...

jywarren commented 10 years ago

Dogi posted this logfile of really long page renders: https://gist.github.com/jywarren/a92c2b2737f2fe797a2d

I think the map/images/foo ones are a red herring, as there doesn't seem to be a way they could possibly generate 600 second long queries... but they do regularly show up just after the "too many connections" lines.

jywarren commented 10 years ago

And we see that normally the /map/images/foo calls don't tax the db at all:

Completed in 235ms (View: 1, DB: 233) | 200 OK [http://mapknitter.org/map/images/mariel] Completed in 490ms (View: 1, DB: 487) | 200 OK [http://mapknitter.org/map/images/marlie] Completed in 612ms (View: 1, DB: 610) | 200 OK [http://mapknitter.org/map/images/melly] Completed in 204ms (View: 1, DB: 202) | 200 OK [http://mapknitter.org/map/images/mia] Completed in 217ms (View: 0, DB: 215) | 200 OK [http://mapknitter.org/map/images/millie] Completed in 574ms (View: 0, DB: 572) | 200 OK [http://mapknitter.org/map/images/mk-demo] Completed in 4240ms (View: 0, DB: 4238) | 200 OK [http://mapknitter.org/map/images/mode] Completed in 8227ms (View: 0, DB: 8225) | 200 OK [http://mapknitter.org/map/images/mugisha] Completed in 401765ms (View: 1, DB: 401762) | 200 OK [http://mapknitter.org/map/images/nadezhda] Completed in 591989ms (View: 4, DB: 591981) | 200 OK [http://mapknitter.org/map/images/pavla] Completed in 608675ms (View: 1, DB: 608673) | 200 OK [http://mapknitter.org/map/images/rayya] Completed in 975210ms (View: 1, DB: 975208) | 200 OK [http://mapknitter.org/map/images/kaycee] Completed in 74334ms (View: 0, DB: 74332) | 200 OK [http://mapknitter.org/map/images/debra] Completed in 1304ms (View: 1, DB: 1299) | 200 OK [http://mapknitter.org/map/images/marden] Completed in 1749ms (View: 0, DB: 1748) | 200 OK [http://mapknitter.org/map/images/rosie] Completed in 602ms (View: 0, DB: 601) | 200 OK [http://mapknitter.org/map/images/chantry-flats-trail-map] Completed in 699ms (View: 2, DB: 725) | 200 OK [http://mapknitter.org/map/images/oasis-middle-dirt] Completed in 905ms (View: 1, DB: 901) | 200 OK [http://mapknitter.org/map/images/grovetown]

jywarren commented 10 years ago

OK, i found this article about "Too many connections": http://stackoverflow.com/questions/14163378/rails-mysql-too-many-connections

which suggests letting mysql connections die after 5 minutes if unused, with this change to database.yml:

production: adapter: mysql
database: **** username: **** password: **** wait_timeout: 300

treehouse-su commented 10 years ago

nice link

jywarren commented 9 years ago

Believe this resolved;