Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support slow log tailing sidcar for tidb instance #290

Merged
merged 10 commits into from
Mar 4, 2019

Conversation

aylei
Copy link
Contributor

@aylei aylei commented Feb 27, 2019

Arbitrary mount point given by user may be harmful, so we don't allow customizing the slow-query-log file location.

close #231

Signed-off-by: Yeh-lei Wu rayingecho@gmail.com

pkg/apis/pingcap.com/v1alpha1/types.go Outdated Show resolved Hide resolved
charts/tidb-cluster/values.yaml Show resolved Hide resolved
tennix
tennix previously approved these changes Feb 27, 2019
Copy link
Member

@tennix tennix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tennix
Copy link
Member

tennix commented Feb 28, 2019

/run-e2e-tests

weekface
weekface previously approved these changes Feb 28, 2019
tennix
tennix previously approved these changes Feb 28, 2019
Copy link
Member

@tennix tennix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tennix
Copy link
Member

tennix commented Feb 28, 2019

/run-e2e-tests

@@ -59,7 +59,11 @@ format = "text"
disable-timestamp = false

# Stores slow query log into separated files.
{{- if .Values.tidb.separateSlowLog }}
slow-query-file = "/tmp/log/tidb/slowlog"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also needs to be changed to /var/log/tidb/slowlog.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch.
BTW, this is kind of a code smell but I can't figure out a better solution. I'll document this caveat or any better ideas?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean user may override the configuration by setting tidb.config

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can specify the command line argument -log-slow-query of tidb-server, Its priority is higher than the configuration file.

# cpu: 50m
# memory: 10Mi
requests: {}
# cpu: 50m
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should specify a request. Very few resources should be needed for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is cpu 20m and memory 5MB a good default for both limit and request? (I've tested locally and seems that 10m cpu, 1MB memory is fairly enough)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, LGTM.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not use a limit or make the limit a bit higher at least until we have observed it in production..

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, maybe 50Mi memory limit is enough. This is pretty small comparing to TiDB itself.

@aylei aylei dismissed stale reviews from tennix and weekface via 7b12348 March 1, 2019 15:12
@aylei
Copy link
Contributor Author

aylei commented Mar 1, 2019

/run-e2e-tests

@aylei
Copy link
Contributor Author

aylei commented Mar 2, 2019

/run-e2e-test

@aylei
Copy link
Contributor Author

aylei commented Mar 2, 2019

/run-e2e-tests

Copy link
Member

@tennix tennix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@weekface weekface merged commit 67090d9 into pingcap:master Mar 4, 2019
shuijing198799 pushed a commit to shuijing198799/tidb-operator that referenced this pull request Mar 15, 2019
* Support slow log tailing sidcar for tidb instance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to view TiDB slow log?
5 participants