{"action":"created","issue":{"url":"https://api.github.com/repos/piwik/piwik/issues/6398","labels_url":"https://api.github.com/repos/piwik/piwik/issues/6398/labels{/name}","comments_url":"https://api.github.com/repos/piwik/piwik/issues/6398/comments","events_url":"https://api.github.com/repos/piwik/piwik/issues/6398/events","html_url":"https://github.com/piwik/piwik/issues/6398","id":45134077,"number":6398,"title":"Tracker: Serialization failure: 1213 Deadlock found when trying to get lock","user":{"login":"integrationtester","id":8353993,"avatar_url":"https://avatars.githubusercontent.com/u/8353993?v=3","gravatar_id":"","url":"https://api.github.com/users/integrationtester","html_url":"https://github.com/integrationtester","followers_url":"https://api.github.com/users/integrationtester/followers","following_url":"https://api.github.com/users/integrationtester/following{/other_user}","gists_url":"https://api.github.com/users/integrationtester/gists{/gist_id}","starred_url":"https://api.github.com/users/integrationtester/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/integrationtester/subscriptions","organizations_url":"https://api.github.com/users/integrationtester/orgs","repos_url":"https://api.github.com/users/integrationtester/repos","events_url":"https://api.github.com/users/integrationtester/events{/privacy}","received_events_url":"https://api.github.com/users/integrationtester/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/piwik/piwik/labels/Bug","name":"Bug","color":"fc2929"},{"url":"https://api.github.com/repos/piwik/piwik/labels/Major","name":"Major","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/piwik/piwik/milestones/20","labels_url":"https://api.github.com/repos/piwik/piwik/milestones/20/labels","id":713698,"number":20,"title":"Short term","description":"You may expect these tickets to be worked on in the next 3 months.\r\n\r\nOur [roadmap](http://piwik.org/roadmap/) for Piwik project is public. \r\n\r\nMost important tickets are moved from here to the next version's milestone. \r\n","creator":{"login":"mattab","id":466765,"avatar_url":"https://avatars.githubusercontent.com/u/466765?v=3","gravatar_id":"","url":"https://api.github.com/users/mattab","html_url":"https://github.com/mattab","followers_url":"https://api.github.com/users/mattab/followers","following_url":"https://api.github.com/users/mattab/following{/other_user}","gists_url":"https://api.github.com/users/mattab/gists{/gist_id}","starred_url":"https://api.github.com/users/mattab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattab/subscriptions","organizations_url":"https://api.github.com/users/mattab/orgs","repos_url":"https://api.github.com/users/mattab/repos","events_url":"https://api.github.com/users/mattab/events{/privacy}","received_events_url":"https://api.github.com/users/mattab/received_events","type":"User","site_admin":false},"open_issues":200,"closed_issues":143,"state":"open","created_at":"2014-06-01T00:00:00Z","updated_at":"2015-02-12T22:14:02Z","due_on":"2015-05-14T12:00:00Z","closed_at":null},"comments":22,"created_at":"2014-10-07T17:12:56Z","updated_at":"2015-02-13T00:52:44Z","closed_at":null,"body":"so i use the tracking api. \r\n\r\nmy code separates actions into groups of 500-800 (depending on session length)\r\n\r\neach group is put into a queue, and threads send these groups to piwik to be tracked.\r\n\r\ncurrently 15 threads send these groups simultaneously.\r\n\r\n\r\n\r\nwhy i do this:\r\nin my particular setup, i did some testing and around 500 was the sweet spot for piwik's ability to handle bulk tracks (less didn't decrease the time much, and more started increasing the time significantly)   \r\n\r\ni also noticed that the times it takes to track these hits doesn't seem to increase much if you have multiple bulk requests at the same time.\r\n\r\n\r\n\r\nthe problem:\r\ni recently upgraded from 2.2.2 to 2.7.0, and now when i run the same importer, i start getting error 500s from the tracker requests.\r\n\r\nlooking at the apache error logs, there seems to be deadlock issues:\r\n\r\n[Tue Oct 07 13:00:01 2014] [error] [client 130.14.24.60] Error in Piwik (tracker): Error query: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction \\t\\t\\t\\t\\t\\t\\t\\tIn query: UPDATE piwikdev_log_visit                     SET idvisitor = ?, visit_total_time = ?, visit_last_action_time = ?, visit_exit_idaction_url = ?,  visit_total_actions = visit_total_actions + 1 , custom_var_k1 = ?, custom_var_v1 = ?                     WHERE idsite = ?                         AND idvisit = ? \\t\\t\\t\\t\\t\\t\\t\\tParameters: array\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/piwik/piwik/issues/comments/74185825","html_url":"https://github.com/piwik/piwik/issues/6398#issuecomment-74185825","issue_url":"https://api.github.com/repos/piwik/piwik/issues/6398","id":74185825,"user":{"login":"medic123de","id":7592498,"avatar_url":"https://avatars.githubusercontent.com/u/7592498?v=3","gravatar_id":"","url":"https://api.github.com/users/medic123de","html_url":"https://github.com/medic123de","followers_url":"https://api.github.com/users/medic123de/followers","following_url":"https://api.github.com/users/medic123de/following{/other_user}","gists_url":"https://api.github.com/users/medic123de/gists{/gist_id}","starred_url":"https://api.github.com/users/medic123de/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/medic123de/subscriptions","organizations_url":"https://api.github.com/users/medic123de/orgs","repos_url":"https://api.github.com/users/medic123de/repos","events_url":"https://api.github.com/users/medic123de/events{/privacy}","received_events_url":"https://api.github.com/users/medic123de/received_events","type":"User","site_admin":false},"created_at":"2015-02-13T00:52:44Z","updated_at":"2015-02-13T00:52:44Z","body":"Hi, I wrote the transaction patch in 2.4.0. I will try to find a solution, I already have an Idea that different Data handling within piwik might be the problem.\r\n\r\nAs long as the analysis takes, please try to set \"bulk_requests_use_transaction = 0\" in config/global.ini\r\nThat should improve the situation at the cost of speed, but not as much as \"recorder = 1\"\r\n"}}