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

High CPU usage #7

Closed
sfxworks opened this issue Mar 30, 2020 · 3 comments
Closed

High CPU usage #7

sfxworks opened this issue Mar 30, 2020 · 3 comments

Comments

@sfxworks
Copy link
Contributor

sfxworks commented Mar 30, 2020

image
With barely any connections, spikes pretty high. Currently deployed as-is with the example servers replaced with my own. Happens with bungee, paper only, and vanilla with the service annotation. I don't see any major hits to the kube-api server, so it doesn't look like it's taxing that thankfully.

There is nothing abnormal in the logs of the mc-router pod.

Version info

Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.4", GitCommit:"8d8aa39598534325ad77120c120a22b3a990b5ea", GitTreeState:"clean", BuildDate:"2020-03-12T21:03:42Z", GoVersion:"go1.13.8", Compiler:"gc", Platform:"windows/amd64"}
Server Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.4", GitCommit:"8d8aa39598534325ad77120c120a22b3a990b5ea", GitTreeState:"clean", BuildDate:"2020-03-12T20:55:23Z", GoVersion:"go1.13.8", Compiler:"gc", Platform:"linux/amd64"}

Node types it was on:

NAME        STATUS   ROLES    AGE    VERSION   INTERNAL-IP      EXTERNAL-IP   OS-IMAGE             KERNEL-VERSION      CONTAINER-RUNTIME
a4          Ready    <none>   120d   v1.17.4   192.xx.xx.xx     <none>        Ubuntu 19.10         5.3.0-42-generic    cri-o://1.16.1
a5          Ready    <none>   120d   v1.17.4   192.xx.xxx.xxx   <none>        Ubuntu 19.10         5.3.0-42-generic    cri-o://1.16.1
@sfxworks
Copy link
Contributor Author

Applied a CPU quota to mitigate this

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    run: mc-router
  name: mc-router
spec:
  selector:
    matchLabels:
      run: mc-router
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        run: mc-router
    spec:
      serviceAccountName: mc-router
      containers:
      - image: itzg/mc-router:1.1.1
        name: mc-router
        args: ["--api-binding", ":8080", "--in-kube-cluster"]
        ports:
        - name: proxy
          containerPort: 25565
        resources:
          requests:
            memory: 1Gi
            cpu: "1"
          limits:
            memory: 1Gi
            cpu: "1"

@sfxworks
Copy link
Contributor Author

Aaaah ya know, I just saw the tag that I was using from the example. I'll change it to your latest and close it if I don't notice it again.

@sfxworks
Copy link
Contributor Author

sfxworks commented Mar 30, 2020

image
All is well!

I'll open up a PR later to update that.

sfxworks added a commit to sfxworks/mc-router that referenced this issue Mar 30, 2020
itzg#7

Deployed it with an older version. Works but ends up spiking in CPU usage. Easy to overlook. 

Also, for good measure/best practice, added resource request/limit.
itzg pushed a commit that referenced this issue Mar 30, 2020
* Update the image version in the example file

#7

Deployed it with an older version. Works but ends up spiking in CPU usage. Easy to overlook. 

Also, for good measure/best practice, added resource request/limit.

* Bad syntax on CPU limit value
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

No branches or pull requests

1 participant