{"action":"created","issue":{"url":"https://api.github.com/repos/mapzen/tileserver/issues/6","labels_url":"https://api.github.com/repos/mapzen/tileserver/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/mapzen/tileserver/issues/6/comments","events_url":"https://api.github.com/repos/mapzen/tileserver/issues/6/events","html_url":"https://github.com/mapzen/tileserver/issues/6","id":114588571,"number":6,"title":"multi-threded operation in tileserver","user":{"login":"silviucm","id":6261881,"avatar_url":"https://avatars.githubusercontent.com/u/6261881?v=3","gravatar_id":"","url":"https://api.github.com/users/silviucm","html_url":"https://github.com/silviucm","followers_url":"https://api.github.com/users/silviucm/followers","following_url":"https://api.github.com/users/silviucm/following{/other_user}","gists_url":"https://api.github.com/users/silviucm/gists{/gist_id}","starred_url":"https://api.github.com/users/silviucm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silviucm/subscriptions","organizations_url":"https://api.github.com/users/silviucm/orgs","repos_url":"https://api.github.com/users/silviucm/repos","events_url":"https://api.github.com/users/silviucm/events{/privacy}","received_events_url":"https://api.github.com/users/silviucm/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-02T12:54:32Z","updated_at":"2015-11-03T19:32:44Z","closed_at":"2015-11-03T19:32:44Z","body":"Hello,\r\n\r\nJust playing around with tileserver as a hobby on the home pc, and I noticed the server spawned by the werkzeug libraries chokes heavily on a single cpu core, while trying to hit the postgis database and render them as json tiles, etc\r\n\r\nI wonder whether it would generally benefit if you allow the threaded parameter be read from config.yaml\r\n\r\n1) Slightly modify the constructor adding threaded parameter explicitly:\r\n```\r\nrun_simple(server_config['host'], server_config['port'], tile_server, threaded=server_config.get('threaded', False),\r\n               use_debugger=server_config.get('debug', False),\r\n               use_reloader=server_config.get('reload', False))\r\n```\r\n\r\n2) Allow the threaded entry in config.yaml, e.g.\r\n```\r\nserver:\r\n  host: localhost\r\n  port: 8099\r\n  debug: true\r\n  reload: true\r\n  threaded: true\r\n```\r\n\r\nI personally noticed a much better distribution of CPU load among cores after that.\r\n\r\nRegards\r\nsilviu"},"comment":{"url":"https://api.github.com/repos/mapzen/tileserver/issues/comments/153463369","html_url":"https://github.com/mapzen/tileserver/issues/6#issuecomment-153463369","issue_url":"https://api.github.com/repos/mapzen/tileserver/issues/6","id":153463369,"user":{"login":"nvkelso","id":853051,"avatar_url":"https://avatars.githubusercontent.com/u/853051?v=3","gravatar_id":"","url":"https://api.github.com/users/nvkelso","html_url":"https://github.com/nvkelso","followers_url":"https://api.github.com/users/nvkelso/followers","following_url":"https://api.github.com/users/nvkelso/following{/other_user}","gists_url":"https://api.github.com/users/nvkelso/gists{/gist_id}","starred_url":"https://api.github.com/users/nvkelso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nvkelso/subscriptions","organizations_url":"https://api.github.com/users/nvkelso/orgs","repos_url":"https://api.github.com/users/nvkelso/repos","events_url":"https://api.github.com/users/nvkelso/events{/privacy}","received_events_url":"https://api.github.com/users/nvkelso/received_events","type":"User","site_admin":false},"created_at":"2015-11-03T19:32:44Z","updated_at":"2015-11-03T19:32:44Z","body":"Closed via PR #7"}}