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

[bug] The EnsureMysqlConf function calculates mysql parameters incorrectly. #244

Closed
runkecheng opened this issue Sep 28, 2021 · 3 comments · Fixed by #265
Closed

[bug] The EnsureMysqlConf function calculates mysql parameters incorrectly. #244

runkecheng opened this issue Sep 28, 2021 · 3 comments · Fixed by #265
Assignees
Labels
bug Something isn't working
Milestone

Comments

@runkecheng
Copy link
Collaborator

runkecheng commented Sep 28, 2021

Describe the problem

The cpu is calculated with PodSpec.Resources, but PodSpec.Resources is not set as the resource quota of the pod.

https://github.com/radondb/radondb-mysql-kubernetes/blob/main/cluster/cluster.go#L282

1632819501

To Reproduce

Expected behavior

Environment:

@runkecheng runkecheng added the bug Something isn't working label Sep 28, 2021
@runkecheng runkecheng added this to the Next milestone Sep 28, 2021
@runkecheng runkecheng self-assigned this Sep 28, 2021
@runkecheng
Copy link
Collaborator Author

runkecheng commented Sep 30, 2021

This will cause the buffer_pool_instances parameter to not be set correctly.

@runkecheng
Copy link
Collaborator Author

runkecheng commented Oct 13, 2021

case1

  • innodb_buffer_pool_instances should be 1. √
  • innodb_buffer_pool_size should be 128mb. √
Pod Spec:
...
    Resources:
      Limits:
        Cpu:     500m
        Memory:  1Gi
      Requests:
        Cpu:        100m
        Memory:     256Mi
...
mysql> SHOW VARIABLES LIKE 'innodb_buffer_pool_%';
+-------------------------------------+----------------+
| Variable_name                       | Value          |
+-------------------------------------+----------------+
| innodb_buffer_pool_instances        | 1              |
| innodb_buffer_pool_size             | 134217728      |
+-------------------------------------+----------------+
11 rows in set (0.01 sec)

case2

-innodb_buffer_pool_instances should be 2.×
-innodb_buffer_pool_size should be 2.5Gi but its 128m. ×

Pod Spec:
...
    Resources:
      Limits:
        Cpu:     4000m
        Memory:  8Gi
      Requests:
        Cpu:        2000m
        Memory:     4Gi
...
mysql> SHOW VARIABLES LIKE 'innodb_buffer_pool_%';
+-------------------------------------+----------------+
| Variable_name                       | Value          |
+-------------------------------------+----------------+
| innodb_buffer_pool_instances        | 1              |
| innodb_buffer_pool_size             | 134217728      |
+-------------------------------------+----------------+
11 rows in set (0.01 sec)

@runkecheng
Copy link
Collaborator Author

runkecheng commented Oct 14, 2021

after modification:

    Resources:
      Limits:
        Cpu:     4000m
        Memory:  8Gi
      Requests:
        Cpu:        2000m
        Memory:     4Gi
  • innodb_buffer_pool_instances should be 2. √
  • innodb_buffer_pool_size should be 2.5G(it must be an integer multiple of innodb_buffer_pool_chunk_size * innodb_buffer_pool_instances). √
mysql> SHOW VARIABLES LIKE 'innodb_buffer_pool_%';
+-------------------------------------+----------------+
| Variable_name                       | Value          |
+-------------------------------------+----------------+
| innodb_buffer_pool_instances        | 2              |
| innodb_buffer_pool_size             | 2684354560     |
+-------------------------------------+----------------+
11 rows in set (0.01 sec)

runkecheng added a commit to runkecheng/radondb-mysql-kubernetes that referenced this issue Oct 14, 2021
runkecheng added a commit to runkecheng/radondb-mysql-kubernetes that referenced this issue Oct 14, 2021
runkecheng added a commit to runkecheng/radondb-mysql-kubernetes that referenced this issue Oct 14, 2021
runkecheng added a commit to runkecheng/radondb-mysql-kubernetes that referenced this issue Oct 14, 2021
runkecheng added a commit to runkecheng/radondb-mysql-kubernetes that referenced this issue Oct 14, 2021
runkecheng added a commit to runkecheng/radondb-mysql-kubernetes that referenced this issue Oct 14, 2021
runkecheng added a commit to runkecheng/radondb-mysql-kubernetes that referenced this issue Oct 15, 2021
runkecheng added a commit to runkecheng/radondb-mysql-kubernetes that referenced this issue Oct 15, 2021
runkecheng added a commit to runkecheng/radondb-mysql-kubernetes that referenced this issue Oct 19, 2021
runkecheng added a commit to runkecheng/radondb-mysql-kubernetes that referenced this issue Oct 19, 2021
runkecheng added a commit to runkecheng/radondb-mysql-kubernetes that referenced this issue Oct 27, 2021
runkecheng added a commit to runkecheng/radondb-mysql-kubernetes that referenced this issue Oct 27, 2021
runkecheng added a commit to runkecheng/radondb-mysql-kubernetes that referenced this issue Oct 27, 2021
runkecheng added a commit to runkecheng/radondb-mysql-kubernetes that referenced this issue Oct 28, 2021
runkecheng added a commit to runkecheng/radondb-mysql-kubernetes that referenced this issue Oct 28, 2021
runkecheng added a commit to runkecheng/radondb-mysql-kubernetes that referenced this issue Oct 28, 2021
runkecheng added a commit to runkecheng/radondb-mysql-kubernetes that referenced this issue Oct 28, 2021
runkecheng added a commit to runkecheng/radondb-mysql-kubernetes that referenced this issue Oct 28, 2021
runkecheng added a commit to runkecheng/radondb-mysql-kubernetes that referenced this issue Oct 28, 2021
runkecheng added a commit to runkecheng/radondb-mysql-kubernetes that referenced this issue Oct 28, 2021
runkecheng added a commit to runkecheng/radondb-mysql-kubernetes that referenced this issue Oct 28, 2021
runkecheng added a commit to runkecheng/radondb-mysql-kubernetes that referenced this issue Oct 28, 2021
runkecheng added a commit to runkecheng/radondb-mysql-kubernetes that referenced this issue Oct 28, 2021
andyli029 added a commit that referenced this issue Oct 28, 2021
*: Fix the setting method of innodb_buffer_pool_instances parameter and change podSpec.Resources name. #244
zhl003 pushed a commit to zhl003/radondb-mysql-kubernetes that referenced this issue Aug 17, 2022
zhl003 pushed a commit to zhl003/radondb-mysql-kubernetes that referenced this issue Aug 17, 2022
zhl003 pushed a commit to zhl003/radondb-mysql-kubernetes that referenced this issue Aug 17, 2022
*: Fix the setting method of innodb_buffer_pool_instances parameter and change podSpec.Resources name. radondb#244
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant