{"action":"created","issue":{"url":"https://api.github.com/repos/pingcap/tidb/issues/8254","repository_url":"https://api.github.com/repos/pingcap/tidb","labels_url":"https://api.github.com/repos/pingcap/tidb/issues/8254/labels{/name}","comments_url":"https://api.github.com/repos/pingcap/tidb/issues/8254/comments","events_url":"https://api.github.com/repos/pingcap/tidb/issues/8254/events","html_url":"https://github.com/pingcap/tidb/issues/8254","id":379114732,"node_id":"MDU6SXNzdWUzNzkxMTQ3MzI=","number":8254,"title":"How to prevent tidb server out of memory","user":{"login":"qw303374929","id":13846202,"node_id":"MDQ6VXNlcjEzODQ2MjAy","avatar_url":"https://avatars0.githubusercontent.com/u/13846202?v=4","gravatar_id":"","url":"https://api.github.com/users/qw303374929","html_url":"https://github.com/qw303374929","followers_url":"https://api.github.com/users/qw303374929/followers","following_url":"https://api.github.com/users/qw303374929/following{/other_user}","gists_url":"https://api.github.com/users/qw303374929/gists{/gist_id}","starred_url":"https://api.github.com/users/qw303374929/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qw303374929/subscriptions","organizations_url":"https://api.github.com/users/qw303374929/orgs","repos_url":"https://api.github.com/users/qw303374929/repos","events_url":"https://api.github.com/users/qw303374929/events{/privacy}","received_events_url":"https://api.github.com/users/qw303374929/received_events","type":"User","site_admin":false},"labels":[{"id":256872091,"node_id":"MDU6TGFiZWwyNTY4NzIwOTE=","url":"https://api.github.com/repos/pingcap/tidb/labels/question","name":"question","color":"fbca04","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2018-11-09T10:54:38Z","updated_at":"2018-11-11T07:58:12Z","closed_at":null,"author_association":"NONE","body":"Detecting expensive SQL consumption memory is about 250MB\r\nObtained by the mem-quota-query=262144000  parameter\r\n\r\nDetailed log：\r\n2018/11/09 18:06:05.089 action.go:44: [warning] [executor:8001]SELECT\r\n\tid,\r\n\tsource,\r\n\tsource_name,\r\n\ttarget,\r\n\ttarget_name,\r\n\toriginal,\r\n\tcreate_time\r\nFROM\r\n\tim_chat_message\r\nWHERE\r\n\tchat_type = 1\r\nORDER BY\r\n\tcreate_time DESC\r\nLIMIT 2000000,50\r\nLIMIT 2534150,50 holds 262152768B memory, exceeds threshold 262144000B.\r\n\"SELECT\r\n\tid,\r\n\tsource,\r\n\tsource_name,\r\n\ttarget,\r\n\ttarget_name,\r\n\toriginal,\r\n\tcreate_time\r\nFROM\r\n\tim_chat_message\r\nWHERE\r\n\tchat_type = 1\r\nORDER BY\r\n\tcreate_time DESC\r\nLIMIT 2000000,50\r\nLIMIT 2534150,50\"{\r\n  \"quota\": 250 MB\r\n  \"consumed\": 250.00836181640625 MB\r\n  \"TopN_10\"{\r\n    \"quota\": 32 GB\r\n    \"consumed\": 250.00836181640625 MB\r\n    \"rowChunks\"{\r\n      \"consumed\": 234.74273681640625 MB\r\n    }\r\n  }\r\n}\r\n\r\n\r\n\r\nA lot of expensive SQL causes the entire cluster to crash，all tidb-server memory cgroup out of memory\r\n\r\nHow to prevent tidb server out of memory？\r\n\r\nIs there any parameter that can be controlled?\r\nHow to configure it, \r\nSo that when new memory is low\r\nother new query requests are waiting\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/pingcap/tidb/issues/comments/437650759","html_url":"https://github.com/pingcap/tidb/issues/8254#issuecomment-437650759","issue_url":"https://api.github.com/repos/pingcap/tidb/issues/8254","id":437650759,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNzY1MDc1OQ==","user":{"login":"zz-jason","id":5268763,"node_id":"MDQ6VXNlcjUyNjg3NjM=","avatar_url":"https://avatars0.githubusercontent.com/u/5268763?v=4","gravatar_id":"","url":"https://api.github.com/users/zz-jason","html_url":"https://github.com/zz-jason","followers_url":"https://api.github.com/users/zz-jason/followers","following_url":"https://api.github.com/users/zz-jason/following{/other_user}","gists_url":"https://api.github.com/users/zz-jason/gists{/gist_id}","starred_url":"https://api.github.com/users/zz-jason/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zz-jason/subscriptions","organizations_url":"https://api.github.com/users/zz-jason/orgs","repos_url":"https://api.github.com/users/zz-jason/repos","events_url":"https://api.github.com/users/zz-jason/events{/privacy}","received_events_url":"https://api.github.com/users/zz-jason/received_events","type":"User","site_admin":false},"created_at":"2018-11-11T07:58:12Z","updated_at":"2018-11-11T07:58:12Z","author_association":"MEMBER","body":"@qw303374929 You can use both `-t` and `-F` options to limit the memory consumption. Take the command in https://github.com/pingcap/docs/blob/master/op-guide/backup-restore.md#backup-data-from-tidb as an example:\r\n\r\n```\r\n./bin/mydumper -h 127.0.0.1 -P 4000 -u root -t 16 -F 64 -B test -T t1,t2 --skip-tz-utc -o ./var/test\r\n```"}}
{"actor":{"display_login":"zz-jason"}}