{"action":"opened","issue":{"url":"https://api.github.com/repos/schollz/find3/issues/8","repository_url":"https://api.github.com/repos/schollz/find3","labels_url":"https://api.github.com/repos/schollz/find3/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/schollz/find3/issues/8/comments","events_url":"https://api.github.com/repos/schollz/find3/issues/8/events","html_url":"https://github.com/schollz/find3/issues/8","id":302063595,"number":8,"title":"Memory leak in server? Also - api/v1/by_location is very slow and CPU/memory intensive?","user":{"login":"victorhooi","id":243499,"avatar_url":"https://avatars3.githubusercontent.com/u/243499?v=4","gravatar_id":"","url":"https://api.github.com/users/victorhooi","html_url":"https://github.com/victorhooi","followers_url":"https://api.github.com/users/victorhooi/followers","following_url":"https://api.github.com/users/victorhooi/following{/other_user}","gists_url":"https://api.github.com/users/victorhooi/gists{/gist_id}","starred_url":"https://api.github.com/users/victorhooi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/victorhooi/subscriptions","organizations_url":"https://api.github.com/users/victorhooi/orgs","repos_url":"https://api.github.com/users/victorhooi/repos","events_url":"https://api.github.com/users/victorhooi/events{/privacy}","received_events_url":"https://api.github.com/users/victorhooi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-04T07:11:37Z","updated_at":"2018-03-04T07:11:37Z","closed_at":null,"author_association":"NONE","body":"I have a find3 server running on a Google Compute Engine instance - `n1-standard-1 (1 vCPU, 3.75 GB memory)`.\r\n\r\nI have five Raspberry PIs that are scanning, and sending fingerprints to this server. I have done training, and added around 8 locations.\r\n\r\nI'm using `docker stats find3server` to track memory usage of `find3server`.\r\n\r\nThe memory usage starts out at around 193 MB. However, there seem to be two issues.\r\n\r\nFirstly, over time the Docker instance appears to consume memory (and not release it), and eventually consumes all machine and crashes the host machine.\r\n\r\nSecondly, if you call the http://server:8003/api/v1/by_location/family_name endpoint, this seems to accelerate the process - it seems to add a few hundred MB each time.\r\n\r\nFor example - initial memory:\r\n\r\n<img width=\"904\" alt=\"screen shot 2018-03-04 at 10 39 31\" src=\"https://user-images.githubusercontent.com/243499/36943083-c3dd25c2-1fd6-11e8-952c-1aa4d024c8fa.png\">\r\n\r\nThen, calling `http GET SERVER_IP_ADDRESS:8003/api/v1/by_location/gcc` - new screenshot of `docker stats find3server` after each call:\r\n\r\n<img width=\"919\" alt=\"screen shot 2018-03-04 at 10 42 35\" src=\"https://user-images.githubusercontent.com/243499/36943093-ddb2b1b0-1fd6-11e8-8b41-658dea5a4c87.png\">\r\n<img width=\"890\" alt=\"screen shot 2018-03-04 at 10 45 05\" src=\"https://user-images.githubusercontent.com/243499/36943094-e14b4d46-1fd6-11e8-8d39-427cbd90c10c.png\">\r\n<img width=\"895\" alt=\"screen shot 2018-03-04 at 11 04 57\" src=\"https://user-images.githubusercontent.com/243499/36943095-e4694b5e-1fd6-11e8-956b-14222233835c.png\">\r\n<img width=\"915\" alt=\"screen shot 2018-03-04 at 11 30 11\" src=\"https://user-images.githubusercontent.com/243499/36943097-e6e27afe-1fd6-11e8-874e-a8da50dc4c0e.png\">\r\n<img width=\"914\" alt=\"screen shot 2018-03-04 at 11 46 26\" src=\"https://user-images.githubusercontent.com/243499/36943098-e908df76-1fd6-11e8-9d30-97c383a4e2e2.png\">\r\n<img width=\"939\" alt=\"screen shot 2018-03-04 at 12 02 22\" src=\"https://user-images.githubusercontent.com/243499/36943099-ec040bc4-1fd6-11e8-8dba-2036179850b2.png\">\r\n\r\nHowever, even just leaving the machine alone, the memory usage climbs on its own.\r\n\r\nAlso, each request against `api/v1/by_location/<family>` takes longer and longer.\r\n\r\nI had to change the httpie timeout from the default of 30 seconds, to 5 minutes, then 10 minutes, to let it complete. After around 5 calls, it would no longer complete even after 10 minutes.\r\n\r\nAlso - even after restarting the entire machine, and starting `find3server` up again - api/v1/by_location still won't complete within 10 minutes =(."}}
{"actor":{"display_login":"victorhooi"}}