High CPU usage and temperatures after script update IPTAG #1424

Closed
opened 2025-11-20 05:10:04 -05:00 by saavagebueno · 42 comments
Owner

Originally created by @kendikaku on GitHub (Jul 4, 2025).

Have you read and understood the above guidelines?

yes

📜 What is the name of the script you are using?

iptag

📂 What was the exact command used to execute the script?

bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/pve/add-iptag.sh)"

⚙️ What settings are you using?

  • Default Settings
  • Advanced Settings

🖥️ Which Linux distribution are you using?

Debian 12

📝 Provide a clear and concise description of the issue.

After updating the script to the latest version, I noticed a significant increase in CPU usage and system temperature.

I’ve already tried uninstalling and reinstalling the script, as well as updating everything again, but the issue persists.

Please let me know if there’s any workaround or if additional logs are needed.

Image

🔄 Steps to reproduce the issue.

after installing or updating to the new version

Paste the full error output (if available).

root@pve:~ ps -ef | grep 'pct config'
root 1243017 1243015 99 09:00 ? 00:00:00 /usr/bin/perl -T /usr/sbin/pct config 201
root 1243027 1243023 99 09:00 ? 00:00:00 /usr/bin/perl -T /usr/sbin/pct config 202
root 1243029 1243024 99 09:00 ? 00:00:00 /usr/bin/perl -T /usr/sbin/pct config 200
root 1243063 1243059 99 09:00 ? 00:00:00 /usr/bin/perl -T /usr/sbin/pct config 203
root 1243073 1243072 99 09:00 ? 00:00:00 /usr/bin/perl -T /usr/sbin/pct config 204
root 1243077 1243074 99 09:00 ? 00:00:00 /usr/bin/perl -T /usr/sbin/pct config 205
root 1243081 1243080 99 09:00 ? 00:00:00 /usr/bin/perl -T /usr/sbin/pct config 206
root 1243085 1242808 0 09:00 pts/0 00:00:00 grep pct config
root@pve:~

🖼️ Additional context (optional).

No response

Originally created by @kendikaku on GitHub (Jul 4, 2025). ### ✅ Have you read and understood the above guidelines? yes ### 📜 What is the name of the script you are using? iptag ### 📂 What was the exact command used to execute the script? bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/pve/add-iptag.sh)" ### ⚙️ What settings are you using? - [x] Default Settings - [ ] Advanced Settings ### 🖥️ Which Linux distribution are you using? Debian 12 ### 📝 Provide a clear and concise description of the issue. After updating the script to the latest version, I noticed a significant increase in CPU usage and system temperature. I’ve already tried uninstalling and reinstalling the script, as well as updating everything again, but the issue persists. Please let me know if there’s any workaround or if additional logs are needed. ![Image](https://github.com/user-attachments/assets/a9c14aa6-34a8-4fcf-a757-d191cb9d7f9b) ### 🔄 Steps to reproduce the issue. after installing or updating to the new version ### ❌ Paste the full error output (if available). root@pve:~ ps -ef | grep 'pct config' root 1243017 1243015 99 09:00 ? 00:00:00 /usr/bin/perl -T /usr/sbin/pct config 201 root 1243027 1243023 99 09:00 ? 00:00:00 /usr/bin/perl -T /usr/sbin/pct config 202 root 1243029 1243024 99 09:00 ? 00:00:00 /usr/bin/perl -T /usr/sbin/pct config 200 root 1243063 1243059 99 09:00 ? 00:00:00 /usr/bin/perl -T /usr/sbin/pct config 203 root 1243073 1243072 99 09:00 ? 00:00:00 /usr/bin/perl -T /usr/sbin/pct config 204 root 1243077 1243074 99 09:00 ? 00:00:00 /usr/bin/perl -T /usr/sbin/pct config 205 root 1243081 1243080 99 09:00 ? 00:00:00 /usr/bin/perl -T /usr/sbin/pct config 206 root 1243085 1242808 0 09:00 pts/0 00:00:00 grep pct config root@pve:~ ### 🖼️ Additional context (optional). _No response_
saavagebueno added the bug label 2025-11-20 05:10:04 -05:00
Author
Owner

@MickLesk commented on GitHub (Jul 4, 2025):

can you try to optimize these file:
/opt/iptag/iptag.conf

with this values:

LXC_IP_CACHE_TTL=300
LXC_STATUS_CACHE_TTL=300
LXC_BATCH_SIZE=5
MAX_PARALLEL_LXC_CHECKS=3

after this: systemctl restart iptag

how it work now?

@MickLesk commented on GitHub (Jul 4, 2025): can you try to optimize these file: /opt/iptag/iptag.conf with this values: ```conf LXC_IP_CACHE_TTL=300 LXC_STATUS_CACHE_TTL=300 LXC_BATCH_SIZE=5 MAX_PARALLEL_LXC_CHECKS=3 ``` after this: systemctl restart iptag how it work now?
Author
Owner

@kendikaku commented on GitHub (Jul 4, 2025):

can you try to optimize these file: /opt/iptag/iptag.conf

with this values:

LXC_IP_CACHE_TTL=300
LXC_STATUS_CACHE_TTL=300
LXC_BATCH_SIZE=5
MAX_PARALLEL_LXC_CHECKS=3

after this: systemctl restart iptag

how it work now?

I'll try and let you know if it works.

I don't know if I can post it here or create a new issue, but every manual tag I add it deletes and leaves only the IP, it shouldn't be like that, right?

EDIT: decreased, but still has high consumption compared to previous versions.

@kendikaku commented on GitHub (Jul 4, 2025): > can you try to optimize these file: /opt/iptag/iptag.conf > > with this values: > > ``` > LXC_IP_CACHE_TTL=300 > LXC_STATUS_CACHE_TTL=300 > LXC_BATCH_SIZE=5 > MAX_PARALLEL_LXC_CHECKS=3 > ``` > > after this: systemctl restart iptag > > how it work now? I'll try and let you know if it works. I don't know if I can post it here or create a new issue, but every manual tag I add it deletes and leaves only the IP, it shouldn't be like that, right? EDIT: decreased, but still has high consumption compared to previous versions.
Author
Owner

@DesertGamer commented on GitHub (Jul 4, 2025):

Please use these commands, I want to see what kind of processor and temperature you have.

apt install i7z
sudo i7z

I also assure you that the script is optimized. I tested it on different systems, with different conditions, and there were no problems.

There are a lot of parameters in the config, I advise you to change them so you get better performance, I'm ready to tell you exactly what you need to change for your system.

Please tell me how many containers and machines you have on the node.

@DesertGamer commented on GitHub (Jul 4, 2025): Please use these commands, I want to see what kind of processor and temperature you have. ``` apt install i7z sudo i7z ``` I also assure you that the script is optimized. I tested it on different systems, with different conditions, and there were no problems. There are a lot of parameters in the config, I advise you to change them so you get better performance, I'm ready to tell you exactly what you need to change for your system. Please tell me how many containers and machines you have on the node.
Author
Owner

@kendikaku commented on GitHub (Jul 4, 2025):

Please use these commands, I want to see what kind of processor and temperature you have.

apt install i7z
sudo i7z

I also assure you that the script is optimized. I tested it on different systems, with different conditions, and there were no problems.

There are a lot of parameters in the config, I advise you to change them so you get better performance, I'm ready to tell you exactly what you need to change for your system.

Please tell me how many containers and machines you have on the node.

Image Image

i5-14500T
Optiplex Micro 7010

The issue is that consumption is high just for a script to check the IP of containers and VMs.
As I mentioned previously, this did not happen in previous versions.

@kendikaku commented on GitHub (Jul 4, 2025): > Please use these commands, I want to see what kind of processor and temperature you have. > > ``` > apt install i7z > sudo i7z > ``` > > I also assure you that the script is optimized. I tested it on different systems, with different conditions, and there were no problems. > > There are a lot of parameters in the config, I advise you to change them so you get better performance, I'm ready to tell you exactly what you need to change for your system. > > Please tell me how many containers and machines you have on the node. <img width="933" height="483" alt="Image" src="https://github.com/user-attachments/assets/4c347918-2b99-41de-9484-6b0e12872b94" /> <img width="299" height="543" alt="Image" src="https://github.com/user-attachments/assets/af0118b0-fa7b-41e9-a125-576dbb85e6d2" /> i5-14500T Optiplex Micro 7010 The issue is that consumption is high just for a script to check the IP of containers and VMs. As I mentioned previously, this did not happen in previous versions.
Author
Owner

@DesertGamer commented on GitHub (Jul 4, 2025):

Image Here are my data and my test server, and as you can see, there are no critical values, everything is fine.

My Processor: CPU E5-2640 v2 @ 2.00GHz (2 Sockets)

@DesertGamer commented on GitHub (Jul 4, 2025): <img width="902" height="638" alt="Image" src="https://github.com/user-attachments/assets/8e44531e-aa7a-4e76-a8f9-3aea721fe4e4" /> Here are my data and my test server, and as you can see, there are no critical values, everything is fine. My Processor: CPU E5-2640 v2 @ 2.00GHz (2 Sockets)
Author
Owner

@DesertGamer commented on GitHub (Jul 4, 2025):

I don't see any critical temperatures, 60 degrees is absolutely normal.

Tell me, please, what processor do you use?

@DesertGamer commented on GitHub (Jul 4, 2025): I don't see any critical temperatures, 60 degrees is absolutely normal. Tell me, please, what processor do you use?
Author
Owner

@DesertGamer commented on GitHub (Jul 4, 2025):

To reduce the load, you can try changing the values for caching, as well as batching (how many containers will be processed at the same time).

# Extreme LXC optimizations
LXC_BATCH_SIZE=20 # You can reduce this value to 5, for example, then 1 iteration will change only 5 machines, not 20, which is probably a lot for your CPU.
LXC_STATUS_CACHE_TTL=30 # This is the caching time, I advise you to set it to about 120 seconds if you are not constantly changing the IP addresses of your servers.
LXC_AGGRESSIVE_CACHING=true
LXC_SKIP_SLOW_METHODS=true

This config is located in /opt/iptag/iptag.conf

@DesertGamer commented on GitHub (Jul 4, 2025): To reduce the load, you can try changing the values for caching, as well as batching (how many containers will be processed at the same time). ``` # Extreme LXC optimizations LXC_BATCH_SIZE=20 # You can reduce this value to 5, for example, then 1 iteration will change only 5 machines, not 20, which is probably a lot for your CPU. LXC_STATUS_CACHE_TTL=30 # This is the caching time, I advise you to set it to about 120 seconds if you are not constantly changing the IP addresses of your servers. LXC_AGGRESSIVE_CACHING=true LXC_SKIP_SLOW_METHODS=true ``` This config is located in /opt/iptag/iptag.conf
Author
Owner

@kendikaku commented on GitHub (Jul 4, 2025):

I don't see any critical temperatures, 60 degrees is absolutely normal.

Tell me, please, what processor do you use?

i5-14500T

My temperature and consumption is almost zero in this configuration that I have. It is in the range of about 40 to 47 degrees with this update of your script it went up 13 degrees or even more

@kendikaku commented on GitHub (Jul 4, 2025): > I don't see any critical temperatures, 60 degrees is absolutely normal. > > Tell me, please, what processor do you use? i5-14500T My temperature and consumption is almost zero in this configuration that I have. It is in the range of about 40 to 47 degrees with this update of your script it went up 13 degrees or even more
Author
Owner

@DesertGamer commented on GitHub (Jul 4, 2025):

I don't see any critical temperatures, 60 degrees is absolutely normal.
Tell me, please, what processor do you use?

i5-14500T

My temperature and consumption is almost zero in this configuration that I have. It is in the range of about 40 to 47 degrees with this update of your script it went up 13 degrees or even more

Try to reduce the number of servers per iteration according to the instructions above. I will definitely change the standard configuration so that there are no such requests and, if necessary, the user can speed up the script. After that, be sure to restart the service so that it pulls up the new config correctly.

@DesertGamer commented on GitHub (Jul 4, 2025): > > I don't see any critical temperatures, 60 degrees is absolutely normal. > > Tell me, please, what processor do you use? > > i5-14500T > > My temperature and consumption is almost zero in this configuration that I have. It is in the range of about 40 to 47 degrees with this update of your script it went up 13 degrees or even more Try to reduce the number of servers per iteration according to the instructions above. I will definitely change the standard configuration so that there are no such requests and, if necessary, the user can speed up the script. After that, be sure to restart the service so that it pulls up the new config correctly.
Author
Owner

@DesertGamer commented on GitHub (Jul 4, 2025):

The fact is that I have tried many configurations and most likely there are several unused variables in the config, sorry for that, I will fix it in a couple of hours.

@DesertGamer commented on GitHub (Jul 4, 2025): The fact is that I have tried many configurations and most likely there are several unused variables in the config, sorry for that, I will fix it in a couple of hours.
Author
Owner

@kendikaku commented on GitHub (Jul 4, 2025):

The fact is that I have tried many configurations and most likely there are several unused variables in the config, sorry for that, I will fix it in a couple of hours.

There is no need to apologize, I only raised this issue because there may be other users who will report the same problem.

@kendikaku commented on GitHub (Jul 4, 2025): > The fact is that I have tried many configurations and most likely there are several unused variables in the config, sorry for that, I will fix it in a couple of hours. There is no need to apologize, I only raised this issue because there may be other users who will report the same problem.
Author
Owner

@DesertGamer commented on GitHub (Jul 4, 2025):

Most likely, it would be correct to add the ability through the config to choose for users to use the batching method (increased CPU consumption, but a faster installation option), or using the standard slower method.

@DesertGamer commented on GitHub (Jul 4, 2025): Most likely, it would be correct to add the ability through the config to choose for users to use the batching method (increased CPU consumption, but a faster installation option), or using the standard slower method.
Author
Owner

@kendikaku commented on GitHub (Jul 4, 2025):

The previous version of the script worked fine, except that it was not recognizing the IP 172.16.0.0/12, otherwise everything worked correctly.

@kendikaku commented on GitHub (Jul 4, 2025): The previous version of the script worked fine, except that it was not recognizing the IP 172.16.0.0/12, otherwise everything worked correctly.
Author
Owner

@DesertGamer commented on GitHub (Jul 4, 2025):

Try to set a lower value in the config, I sent you the instructions and a description of the points above, I set other values and immediately saw a drop in CPU consumption.

@DesertGamer commented on GitHub (Jul 4, 2025): Try to set a lower value in the config, I sent you the instructions and a description of the points above, I set other values and immediately saw a drop in CPU consumption.
Author
Owner

@kendikaku commented on GitHub (Jul 4, 2025):

Another detail that this update changed is that every manually created tag is deleted, no matter what I do.

@kendikaku commented on GitHub (Jul 4, 2025): Another detail that this update changed is that every manually created tag is deleted, no matter what I do.
Author
Owner

@DesertGamer commented on GitHub (Jul 4, 2025):

This is interesting, I have not observed such behavior, stop the service.

systemctl stop iptag

Go to the /opt/iptag/iptag.conf configuration. Change the DEBUG field to true, then restart the service.
Then use the command to view the service logs in real time, and then send me the full log of any of your machines where the tag was. (Her ID will be visible there)

journalctl -u iptag -f

Just don't forget to install custom tags on several machines.

@DesertGamer commented on GitHub (Jul 4, 2025): This is interesting, I have not observed such behavior, stop the service. ``` systemctl stop iptag ``` Go to the /opt/iptag/iptag.conf configuration. Change the DEBUG field to true, then restart the service. Then use the command to view the service logs in real time, and then send me the full log of any of your machines where the tag was. (Her ID will be visible there) ``` journalctl -u iptag -f ``` Just don't forget to install custom tags on several machines.
Author
Owner

@kendikaku commented on GitHub (Jul 4, 2025):

debug.txt

strangely now it didn't delete the manually added tags.

EDIT: Even with the changes you gave me, I'm having peaks of 76 - 80 degrees.

My PVE is around 43 degrees and the processing is almost idle in the configuration I sent.

With the script, there are peaks of 10-20% in processing.

@kendikaku commented on GitHub (Jul 4, 2025): [debug.txt](https://github.com/user-attachments/files/21064202/debug.txt) strangely now it didn't delete the manually added tags. EDIT: Even with the changes you gave me, I'm having peaks of 76 - 80 degrees. My PVE is around 43 degrees and the processing is almost idle in the configuration I sent. With the script, there are peaks of 10-20% in processing.
Author
Owner

@DesertGamer commented on GitHub (Jul 4, 2025):

Please show me your configuration.

@DesertGamer commented on GitHub (Jul 4, 2025): Please show me your configuration.
Author
Owner

@kendikaku commented on GitHub (Jul 4, 2025):

i5-14500t
optiplex micro 7010
40gb ddr4
nvme 1tb
hd 1tb

@kendikaku commented on GitHub (Jul 4, 2025): i5-14500t optiplex micro 7010 40gb ddr4 nvme 1tb hd 1tb
Author
Owner

@MickLesk commented on GitHub (Jul 4, 2025):

My n95 Dev PC has 26 Container and this Script. Idle 4% CPU

@MickLesk commented on GitHub (Jul 4, 2025): My n95 Dev PC has 26 Container and this Script. Idle 4% CPU
Author
Owner

@DesertGamer commented on GitHub (Jul 4, 2025):

Bro, I need an iptag configuration.

@DesertGamer commented on GitHub (Jul 4, 2025): Bro, I need an iptag configuration.
Author
Owner

@kendikaku commented on GitHub (Jul 4, 2025):

Bro, I need an iptag configuration.

default with these settings that you gave me and I also tried the ones that @MickLesk https://github.com/community-scripts/ProxmoxVE/issues/5701#issuecomment-3036196212

https://github.com/community-scripts/ProxmoxVE/issues/5701#issuecomment-3036863212

@kendikaku commented on GitHub (Jul 4, 2025): > Bro, I need an iptag configuration. default with these settings that you gave me and I also tried the ones that @MickLesk https://github.com/community-scripts/ProxmoxVE/issues/5701#issuecomment-3036196212 https://github.com/community-scripts/ProxmoxVE/issues/5701#issuecomment-3036863212
Author
Owner

@DesertGamer commented on GitHub (Jul 4, 2025):

I gave you the settings and explained what each of them does, you need to reduce my settings necessarily because you don't have a powerful system.

@DesertGamer commented on GitHub (Jul 4, 2025): I gave you the settings and explained what each of them does, you need to reduce my settings necessarily because you don't have a powerful system.
Author
Owner

@kendikaku commented on GitHub (Jul 4, 2025):

My n95 Dev PC has 26 Container and this Script. Idle 4% CPU

but his system is inferior to mine and does not present the same error.

@kendikaku commented on GitHub (Jul 4, 2025): > My n95 Dev PC has 26 Container and this Script. Idle 4% CPU but his system is inferior to mine and does not present the same error.
Author
Owner

@Duratori commented on GitHub (Jul 5, 2025):

I can confirm the issue of CPU usage and strange temperature increase with this updated script. The prior version had essentially no impact on my CPU usage or temperature. This new one pushed my CPU temps to a continuous 71+, which is.a 20 degrees higher than idle. See attached photo. I'm running this on an AMD 9955HX CPU. The amount of CPU this new script is consuming is crazy high for my 16-core, 32-thread server. The spike in the photo is when I upgraded to and ran the new script, versus the original script before the upgrade, and after I terminated the new script.

Image
@Duratori commented on GitHub (Jul 5, 2025): I can confirm the issue of CPU usage and strange temperature increase with this updated script. The prior version had essentially no impact on my CPU usage or temperature. This new one pushed my CPU temps to a continuous 71+, which is.a 20 degrees higher than idle. See attached photo. I'm running this on an AMD 9955HX CPU. The amount of CPU this new script is consuming is crazy high for my 16-core, 32-thread server. The spike in the photo is when I upgraded to and ran the new script, versus the original script before the upgrade, and after I terminated the new script. <img width="1003" height="333" alt="Image" src="https://github.com/user-attachments/assets/da59fcee-4d9a-4236-a3e4-2073a040414f" />
Author
Owner

@DesertGamer commented on GitHub (Jul 5, 2025):

I can confirm the issue of CPU usage and strange temperature increase with this updated script. The prior version had essentially no impact on my CPU usage or temperature. This new one pushed my CPU temps to a continuous 71+, which is.a 20 degrees higher than idle. See attached photo. I'm running this on an AMD 9955HX CPU. The amount of CPU this new script is consuming is crazy high for my 16-core, 32-thread server. The spike in the photo is when I upgraded to and ran the new script, versus the original script before the upgrade, and after I terminated the new script.
Image

Please show me the config.
It is located in /opt/iptag/iptag.conf

@DesertGamer commented on GitHub (Jul 5, 2025): > I can confirm the issue of CPU usage and strange temperature increase with this updated script. The prior version had essentially no impact on my CPU usage or temperature. This new one pushed my CPU temps to a continuous 71+, which is.a 20 degrees higher than idle. See attached photo. I'm running this on an AMD 9955HX CPU. The amount of CPU this new script is consuming is crazy high for my 16-core, 32-thread server. The spike in the photo is when I upgraded to and ran the new script, versus the original script before the upgrade, and after I terminated the new script. > <img alt="Image" width="1003" height="333" src="https://private-user-images.githubusercontent.com/26017005/462726530-da59fcee-4d9a-4236-a3e4-2073a040414f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTE2OTQ2NDcsIm5iZiI6MTc1MTY5NDM0NywicGF0aCI6Ii8yNjAxNzAwNS80NjI3MjY1MzAtZGE1OWZjZWUtNGQ5YS00MjM2LWEzZTQtMjA3M2EwNDA0MTRmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA3MDUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNzA1VDA1NDU0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTgzMmNhOGY3ZTJlNmI0MzE3ZTZmZjMzNTM5ZGQ1ZDVkYTM1OWQ3MDYxNWFkMTE1YjA0NmU2MjY3MDJkNWJlNTQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.qSD5sSWLGLvKCaqKyqClxb6h0FyMceaoQzi-6xzf6jg"> Please show me the config. It is located in /opt/iptag/iptag.conf
Author
Owner

@Duratori commented on GitHub (Jul 5, 2025):

# Configuration file for LXC IP tagging

# List of allowed CIDRs
CIDR_LIST=(
  192.168.0.0/16
  10.0.0.0/8
  100.64.0.0/10
)

# Tag format options:
# - "full": full IP address (e.g., 192.168.0.100)
# - "last_octet": only the last octet (e.g., 100)
# - "last_two_octets": last two octets (e.g., 0.100)
TAG_FORMAT="last_two_octets"

# Interval settings (in seconds) - optimized for lower CPU usage
LOOP_INTERVAL=300
VM_STATUS_CHECK_INTERVAL=600
FW_NET_INTERFACE_CHECK_INTERVAL=900
LXC_STATUS_CHECK_INTERVAL=300
FORCE_UPDATE_INTERVAL=7200

# Performance optimizations
VM_IP_CACHE_TTL=120
MAX_PARALLEL_VM_CHECKS=5

# LXC performance optimizations  
LXC_IP_CACHE_TTL=0
MAX_PARALLEL_LXC_CHECKS=7

# Extreme LXC optimizations
LXC_BATCH_SIZE=20
LXC_STATUS_CACHE_TTL=30
LXC_AGGRESSIVE_CACHING=true
LXC_SKIP_SLOW_METHODS=true

# Debug settings (set to true to enable debugging)
DEBUG=false
@Duratori commented on GitHub (Jul 5, 2025): ``` # Configuration file for LXC IP tagging # List of allowed CIDRs CIDR_LIST=( 192.168.0.0/16 10.0.0.0/8 100.64.0.0/10 ) # Tag format options: # - "full": full IP address (e.g., 192.168.0.100) # - "last_octet": only the last octet (e.g., 100) # - "last_two_octets": last two octets (e.g., 0.100) TAG_FORMAT="last_two_octets" # Interval settings (in seconds) - optimized for lower CPU usage LOOP_INTERVAL=300 VM_STATUS_CHECK_INTERVAL=600 FW_NET_INTERFACE_CHECK_INTERVAL=900 LXC_STATUS_CHECK_INTERVAL=300 FORCE_UPDATE_INTERVAL=7200 # Performance optimizations VM_IP_CACHE_TTL=120 MAX_PARALLEL_VM_CHECKS=5 # LXC performance optimizations LXC_IP_CACHE_TTL=0 MAX_PARALLEL_LXC_CHECKS=7 # Extreme LXC optimizations LXC_BATCH_SIZE=20 LXC_STATUS_CACHE_TTL=30 LXC_AGGRESSIVE_CACHING=true LXC_SKIP_SLOW_METHODS=true # Debug settings (set to true to enable debugging) DEBUG=false ```
Author
Owner

@Duratori commented on GitHub (Jul 5, 2025):

I believe the issue is that the service is configured with Restart=always and RestartSec=1, which means when the script finishes (after running check once), systemd immediately restarts it after just 1 second. This is causing the continuous loop behavior and high CPU usage. I notice that any change I make to the configuration is implemented immediately. There is no delay. The script is looping continuously.

@Duratori commented on GitHub (Jul 5, 2025): I believe the issue is that the service is configured with Restart=always and RestartSec=1, which means when the script finishes (after running check once), systemd immediately restarts it after just 1 second. This is causing the continuous loop behavior and high CPU usage. I notice that any change I make to the configuration is implemented immediately. There is no delay. The script is looping continuously.
Author
Owner

@CrazyWolf13 commented on GitHub (Jul 5, 2025):

I just tested this script on my Testing node with a bit of an older CPU (i5-4570T) nevertheless from stable 1.2% to nearly 20% CPU is way too much.

@DesertGamer Please take a look.

Image

EDIT:

Could you please make this script write less to syslog, it becomes really hard to debug actual errors if there is just so much spam from this one actually very non-important script in syslog:

ul 05 08:15:40 lenovo7 systemd[1]: iptag.service: Deactivated successfully.
Jul 05 08:15:40 lenovo7 systemd[1]: iptag.service: Consumed 4.894s CPU time.
Jul 05 08:15:41 lenovo7 systemd[1]: iptag.service: Scheduled restart job, restart counter is at 55.
Jul 05 08:15:41 lenovo7 systemd[1]: Stopped iptag.service - IP-Tag service.
Jul 05 08:15:41 lenovo7 systemd[1]: iptag.service: Consumed 4.894s CPU time.
Jul 05 08:15:41 lenovo7 systemd[1]: Started iptag.service - IP-Tag service.
Jul 05 08:15:41 lenovo7 iptag[1521611]: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Jul 05 08:15:41 lenovo7 iptag[1521611]: ✓ IP-Tag service started successfully
Jul 05 08:15:41 lenovo7 iptag[1521611]: ℹ Loop interval: 300 seconds
Jul 05 08:15:41 lenovo7 iptag[1521611]: ℹ Debug mode: false
Jul 05 08:15:41 lenovo7 iptag[1521611]: ℹ Tag format: last_two_octets
Jul 05 08:15:41 lenovo7 iptag[1521611]: ℹ Allowed CIDRs: 192.168.0.0/16 10.0.0.0/8 100.64.0.0/10
Jul 05 08:15:41 lenovo7 iptag[1521611]: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Jul 05 08:15:42 lenovo7 iptag[1521611]: ⚠ LXC status changes detected, updating tags
Jul 05 08:15:42 lenovo7 iptag[1521611]: ℹ Processing 1 LXC container(s) in parallel
Jul 05 08:15:44 lenovo7 iptag[1521626]: = LXC 230: No IP detected, tags unchanged
Jul 05 08:15:44 lenovo7 iptag[1521611]: ✓ Completed processing LXC containers
Jul 05 08:15:44 lenovo7 iptag[1521611]: ⚠ Network interface changes detected, updating all tags
Jul 05 08:15:45 lenovo7 iptag[1521611]: ℹ Processing 1 LXC container(s) in parallel
Jul 05 08:15:46 lenovo7 iptag[1521689]: = LXC 230: No IP detected, tags unchanged
Jul 05 08:15:47 lenovo7 iptag[1521611]: ✓ Completed processing LXC containers

Also these emojis and colors don't really render well in Terminal enviroments when you debug syslog.

@CrazyWolf13 commented on GitHub (Jul 5, 2025): I just tested this script on my Testing node with a bit of an older CPU (i5-4570T) nevertheless from stable 1.2% to nearly 20% CPU is way too much. @DesertGamer Please take a look. <img width="1435" height="433" alt="Image" src="https://github.com/user-attachments/assets/64f89034-79f5-4e7d-baf3-b80e7217d652" /> EDIT: Could you please make this script write less to syslog, it becomes really hard to debug actual errors if there is just so much spam from this one actually very non-important script in syslog: ```bash ul 05 08:15:40 lenovo7 systemd[1]: iptag.service: Deactivated successfully. Jul 05 08:15:40 lenovo7 systemd[1]: iptag.service: Consumed 4.894s CPU time. Jul 05 08:15:41 lenovo7 systemd[1]: iptag.service: Scheduled restart job, restart counter is at 55. Jul 05 08:15:41 lenovo7 systemd[1]: Stopped iptag.service - IP-Tag service. Jul 05 08:15:41 lenovo7 systemd[1]: iptag.service: Consumed 4.894s CPU time. Jul 05 08:15:41 lenovo7 systemd[1]: Started iptag.service - IP-Tag service. Jul 05 08:15:41 lenovo7 iptag[1521611]: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Jul 05 08:15:41 lenovo7 iptag[1521611]: ✓ IP-Tag service started successfully Jul 05 08:15:41 lenovo7 iptag[1521611]: ℹ Loop interval: 300 seconds Jul 05 08:15:41 lenovo7 iptag[1521611]: ℹ Debug mode: false Jul 05 08:15:41 lenovo7 iptag[1521611]: ℹ Tag format: last_two_octets Jul 05 08:15:41 lenovo7 iptag[1521611]: ℹ Allowed CIDRs: 192.168.0.0/16 10.0.0.0/8 100.64.0.0/10 Jul 05 08:15:41 lenovo7 iptag[1521611]: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Jul 05 08:15:42 lenovo7 iptag[1521611]: ⚠ LXC status changes detected, updating tags Jul 05 08:15:42 lenovo7 iptag[1521611]: ℹ Processing 1 LXC container(s) in parallel Jul 05 08:15:44 lenovo7 iptag[1521626]: = LXC 230: No IP detected, tags unchanged Jul 05 08:15:44 lenovo7 iptag[1521611]: ✓ Completed processing LXC containers Jul 05 08:15:44 lenovo7 iptag[1521611]: ⚠ Network interface changes detected, updating all tags Jul 05 08:15:45 lenovo7 iptag[1521611]: ℹ Processing 1 LXC container(s) in parallel Jul 05 08:15:46 lenovo7 iptag[1521689]: = LXC 230: No IP detected, tags unchanged Jul 05 08:15:47 lenovo7 iptag[1521611]: ✓ Completed processing LXC containers ``` Also these emojis and colors don't really render well in Terminal enviroments when you debug syslog.
Author
Owner

@DesertGamer commented on GitHub (Jul 5, 2025):

@CrazyWolf13 @Duratori

LXC_BATCH_SIZE=20 # You can reduce this value to 5, for example, then 1 iteration will change only 5 machines, not 20, which is probably a lot for your CPU.
LXC_STATUS_CACHE_TTL=30 # This is the caching time, I advise you to set it to about 120 seconds if you are not constantly changing the IP addresses of your servers.
LXC_AGGRESSIVE_CACHING=true
LXC_SKIP_SLOW_METHODS=true

I have already sent you what you need to change-since you have old processors, you need to change the number of servers processed at a time. This can be adjusted in LXC_BATCH_SIZE, let's say set 5, you will see significant changes

@DesertGamer commented on GitHub (Jul 5, 2025): @CrazyWolf13 @Duratori ``` LXC_BATCH_SIZE=20 # You can reduce this value to 5, for example, then 1 iteration will change only 5 machines, not 20, which is probably a lot for your CPU. LXC_STATUS_CACHE_TTL=30 # This is the caching time, I advise you to set it to about 120 seconds if you are not constantly changing the IP addresses of your servers. LXC_AGGRESSIVE_CACHING=true LXC_SKIP_SLOW_METHODS=true ``` I have already sent you what you need to change-since you have old processors, you need to change the number of servers processed at a time. This can be adjusted in LXC_BATCH_SIZE, let's say set 5, you will see significant changes
Author
Owner

@CrazyWolf13 commented on GitHub (Jul 5, 2025):

@DesertGamer if defaults are using that much ressources they should not be defaults, I'll discuss it with the team what we do regarding your script.

@CrazyWolf13 commented on GitHub (Jul 5, 2025): @DesertGamer if defaults are using that much ressources they should not be defaults, I'll discuss it with the team what we do regarding your script.
Author
Owner

@DesertGamer commented on GitHub (Jul 5, 2025):

@CrazyWolf13 I don't see a problem to just change the standard configuration and make an additional commit.

@DesertGamer commented on GitHub (Jul 5, 2025): @CrazyWolf13 I don't see a problem to just change the standard configuration and make an additional commit.
Author
Owner

@DesertGamer commented on GitHub (Jul 5, 2025):

@MickLesk, @CrazyWolf13 In any case, this situation needs to be solved, I'm concerned with the speed of the script, but in principle we can increase the time after which the script will restart, which will give a short-term peak, and you can also add the option to select the method of obtaining IP with warnings during installation, am I doing this?

@DesertGamer commented on GitHub (Jul 5, 2025): @MickLesk, @CrazyWolf13 In any case, this situation needs to be solved, I'm concerned with the speed of the script, but in principle we can increase the time after which the script will restart, which will give a short-term peak, and you can also add the option to select the method of obtaining IP with warnings during installation, am I doing this?
Author
Owner

@kendikaku commented on GitHub (Jul 5, 2025):

I'm testing this script and the same problem doesn't happen, the script takes 60 seconds to update but this time can be adjusted and I don't have that much load on my processor, since it's open source I can give you some insight into your script https://github.com/MorsStefan/proxmox-ip2tag

@kendikaku commented on GitHub (Jul 5, 2025): I'm testing this script and the same problem doesn't happen, the script takes 60 seconds to update but this time can be adjusted and I don't have that much load on my processor, since it's open source I can give you some insight into your script https://github.com/MorsStefan/proxmox-ip2tag
Author
Owner

@MickLesk commented on GitHub (Jul 5, 2025):

I can take a look at monday

@MickLesk commented on GitHub (Jul 5, 2025): I can take a look at monday
Author
Owner

@CrazyWolf13 commented on GitHub (Jul 5, 2025):

@DesertGamer
In my eyes a script to set a simple tag should never use that much ressources, this is using way more than a windows VM is using of my host CPU! And needs 1.3k lines of code.

At least for now turning the default variables down and letting users manually run this is a better solution should be the way to go. Maybe also an info on how to run manually would be nice.

We'll discuss this further in the team.

@CrazyWolf13 commented on GitHub (Jul 5, 2025): @DesertGamer In my eyes a script to set a simple tag should never use that much ressources, this is using way more than a windows VM is using of my host CPU! And needs 1.3k lines of code. At least for now turning the default variables down and letting users manually run this is a better solution should be the way to go. Maybe also an info on how to run manually would be nice. We'll discuss this further in the team.
Author
Owner

@DesertGamer commented on GitHub (Jul 5, 2025):

I think it will just take longer testing, this script has a lot of functionality and ways to get an IP, all of which can be shortened.

@DesertGamer commented on GitHub (Jul 5, 2025): I think it will just take longer testing, this script has a lot of functionality and ways to get an IP, all of which can be shortened.
Author
Owner

@DesertGamer commented on GitHub (Jul 5, 2025):

I'll review how much resources my script really takes up, take until Monday to test it, and update it on Monday.

@DesertGamer commented on GitHub (Jul 5, 2025): I'll review how much resources my script really takes up, take until Monday to test it, and update it on Monday.
Author
Owner

@MickLesk commented on GitHub (Jul 5, 2025):

The Problem is the process_parallel_lxc. PCT config need many Ressources. If you have 10+ LXC every LXC need 1-5sec with CPU throttling.

@MickLesk commented on GitHub (Jul 5, 2025): The Problem is the process_parallel_lxc. PCT config need many Ressources. If you have 10+ LXC every LXC need 1-5sec with CPU throttling.
Author
Owner

@DesertGamer commented on GitHub (Jul 5, 2025):

Yes, I immediately realized that this was the case-that I would fix it and minimize the processor costs for this task as much as possible.

@DesertGamer commented on GitHub (Jul 5, 2025): Yes, I immediately realized that this was the case-that I would fix it and minimize the processor costs for this task as much as possible.
Author
Owner

@lslvxy commented on GitHub (Jul 5, 2025):

same issue with me

@lslvxy commented on GitHub (Jul 5, 2025): same issue with me
Author
Owner

@MickLesk commented on GitHub (Jul 7, 2025):

im now from 0,5 % in idle > 6,5% with my better cpu for round about 10sec.

my dirty bullshit pc (n95) consumes in idle atm ~4% and while updating and to update 7 container (5 sec) it expands to 30% (pct config is hungry, thats an proxmox thing) - More is not possible! If you still don't want to take it, you don't have to use it. Further optimizations are almost impossible.

There is now an action “iptag-run” where you can see the full output and run it manually. Alternatively, you can stop the service and do it manually.

@MickLesk commented on GitHub (Jul 7, 2025): im now from 0,5 % in idle > 6,5% with my better cpu for round about 10sec. my dirty bullshit pc (n95) consumes in idle atm ~4% and while updating and to update 7 container (5 sec) it expands to 30% (pct config is hungry, thats an proxmox thing) - More is not possible! If you still don't want to take it, you don't have to use it. Further optimizations are almost impossible. There is now an action “iptag-run” where you can see the full output and run it manually. Alternatively, you can stop the service and do it manually.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/ProxmoxVE#1424