By Advait Sakhalkar on September 5, 2024
Beginner
i there,I am experiencing an issue with my Docker container running Apache Superset where the CPU usage shows 100%, but htop indicates that only one core is being utilized.Here is the relevant part of my Docker configuration:
"HostConfig": {
   "Binds": [
       "/home/debezium/superset/tests:/app/tests:rw",
       "/home/debezium/superset/docker:/app/docker:rw",
       "/home/debezium/superset/superset:/app/superset:rw",
       "/home/debezium/superset/superset-frontend:/app/superset-frontend:rw"
   ],
   "ContainerIDFile": "",
   "LogConfig": {
       "Type": "json-file",
       "Config": {}
   },
   "NetworkMode": "superset_default",
   "PortBindings": {},
   "RestartPolicy": {
       "Name": "unless-stopped",
       "MaximumRetryCount": 0
   },
   "AutoRemove": false,
   "VolumeDriver": "",
   "VolumesFrom": null,
   "ConsoleSize": [
       0,
       0
   ],
   "CapAdd": null,
   "CapDrop": null,
   "CgroupnsMode": "host",
   "Dns": null,
   "DnsOptions": null,
   "DnsSearch": null,
   "ExtraHosts": [
       "host.docker.internal:host-gateway"
   ],
   "GroupAdd": null,
   "IpcMode": "private",
   "Cgroup": "",
   "Links": null,
   "OomScoreAdj": 0,
   "PidMode": "",
   "Privileged": false,
   "PublishAllPorts": false,
   "ReadonlyRootfs": false,
   "SecurityOpt": null,
   "UTSMode": "",
   "UsernsMode": "",
   "ShmSize": 67108864,
   "Runtime": "runc",
   "Isolation": "",
   "CpuShares": 0,
   "Memory": 0,
   "NanoCpus": 0,
   "CgroupParent": "",
   "BlkioWeight": 0,
   "BlkioWeightDevice": null,
   "BlkioDeviceReadBps": null,
   "BlkioDeviceWriteBps": null,
   "BlkioDeviceReadIOps": null,
   "BlkioDeviceWriteIOps": null,
   "CpuPeriod": 0,
   "CpuQuota": 0,
   "CpuRealtimePeriod": 0,
   "CpuRealtimeRuntime": 0,
   "CpusetCpus": "",
   "CpusetMems": "",
   "Devices": null,
   "DeviceCgroupRules": null,
   "DeviceRequests": null,
   "MemoryReservation": 0,
   "MemorySwap": 0,
   "MemorySwappiness": null,
   "OomKillDisable": false,
   "PidsLimit": null,
   "Ulimits": null,
   "CpuCount": 0,
   "CpuPercent": 0,
   "IOMaximumIOps": 0,
   "IOMaximumBandwidth": 0,
   "Mounts": [
       {
           "Type": "volume",
           "Source": "superset_superset_home",
           "Target": "/app/superset_home",
           "VolumeOptions": {}
       }
   ],
   "MaskedPaths": [
       "/proc/asound",
       "/proc/acpi",
       "/proc/kcore",
       "/proc/keys",
       "/proc/latency_stats",
       "/proc/timer_list",
       "/proc/timer_stats",
       "/proc/sched_debug",
       "/proc/scsi",
       "/sys/firmware",
       "/sys/devices/virtual/powercap"
   ],
   "ReadonlyPaths": [
       "/proc/bus",
       "/proc/fs",
       "/proc/irq",
       "/proc/sys",
       "/proc/sysrq-trigger"
   ]
}

I have not set any specific limits on CPU usage or CPU affinity, as seen in the configuration. Despite this, only one core seems to be fully utilized while the rest remain idle.Has anyone experienced a similar issue with Apache Superset in Docker, and if so, how did you resolve it? Any guidance on what might be causing this and how to ensure that the container can utilize all available CPU cores would be greatly appreciated.Thank you for your help!

12



Replies:1 comment

  1. Oldest
  2. Newest
  3. Top



dosubot[bot]

boton Jul 4

Hello @ruslan-murzag! I'm here to help you out with any issues or questions you have. Let's take a look at your Docker container challenge together!The issue of only one CPU core being utilized in your Docker container running Apache Superset could be related to the worker_processes directive in the Nginx configuration file. In the provided nginx.conf, the worker_processes is set to 1, which means Nginx is configured to use only one CPU core.To resolve this issue, you can increase the number of worker processes to match the number of CPU cores available on your machine. For example, you can set it to auto to automatically adjust to the number of available CPU cores:
worker_processes auto;

Here is the modified section of the nginx.conf:
user  nginx;
worker_processes  auto;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;

events {
   worker_connections  1024;
}
This change should allow Nginx to utilize all available CPU cores, potentially improving the performance of your Apache Superset instance [1].To continue talking to Dosu, mention @dosu.



More articles on Superset



More articles on Superset
Comments

No comments yet.

Add a comment
Ctrl+Enter to add comment