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

Webserver slow in startup and in UI #3046

Open
PartTheSeas opened this issue Dec 12, 2024 · 5 comments
Open

Webserver slow in startup and in UI #3046

PartTheSeas opened this issue Dec 12, 2024 · 5 comments

Comments

@PartTheSeas
Copy link

Describe the bug
I don't know how I would verify or or print this behavior, but the web server is super slow in startup (20 secs+) and if I refresh the tab in my browser it takes another 20+ secs to reload

To Reproduce
Steps to reproduce the behavior:
No idea if it's just me, let me know what you need and how I can retreive it

Expected behavior
Startup time should be a few seconds and refreshing the UI as well at max

Environement (please complete the following information)

  • Windows 11
  • Glances & psutil versions:
    Glances version: 4.2.1
    Glances API version: 4
    PsUtil version: 6.1.0
    Log file: C:\Users\Donatus\AppData\Local\Temp\glances-Donatus.log
  • How do you install Glances (Pypi package, script, package manager, source): pip install glances[all]
  • Glances test: Curses module not found. Glances cannot start in standalone mode.
@PartTheSeas
Copy link
Author

An update on this.

After doing some research I found out that the windows-curses package seems not to work with python3.9 or above, so I downgraded python to 3.9 and was able to install the windows-curses package.

Glances seems much more responsive now, even though not blazingly fast, but way faster.

Could this have been the culprit? Is there anything else I can do to improve the performance on Windows?

Kind regards ❤️

@nicolargo
Copy link
Owner

Hi @PartTheSeas

On his Pypi page, Windows-curses seems to be compliant with Python 3.6 to 3.12. Did you try to install the latest version (2.4) ?

Perhaps slow start issue came from another think.

Can you also send us the result of the following command:

glances --issue

@PartTheSeas
Copy link
Author

PartTheSeas commented Dec 14, 2024

I don't know. If I install curses with python > 3.9 I get the curses error I described in my first post, so I googled a bit and downgraded to 3.9.

Can you also send us the result of the following command

glances --issue

Of course! There you go:

glances --issue
===============================================================================
Glances 4.2.1 (C:\Users\Donatus\AppData\Roaming\Python\Python39\site-packages\glances\__init__.py)
Python 3.9.0 (c:\program files\python39\python.exe)
PsUtil 6.1.0 (C:\Users\Donatus\AppData\Roaming\Python\Python39\site-packages\psutil\__init__.py)
===============================================================================
alert         [OK]    0.00000s
[]
amps          [OK]    0.00000s
[]
cloud         [OK]    0.00000s
{}
connections   [OK]    0.00211s
{'ESTABLISHED': 269,
 'LISTEN': 93,
 'SYN_RECV': 0,
 'SYN_SENT': 1,
 'initiated': 1,
 'net_connections_enabled': True,
 'nf_conntrack_enabled': False,
 'terminated': 1}
containers    [OK]    0.00000s
{}
core          [OK]    0.00000s
{'log': 32, 'phys': 24}
cpu           [OK]    0.00000s
{'cpucore': 32,
 'ctx_switches': 2227879,
 'ctx_switches_gauge': 1710985636,
 'ctx_switches_rate_per_sec': 197579.0,
 'dpc': 0.5,
 'idle': 69.7,
 'interrupts': 1720791,
 'interrupts_gauge': 4040171213,
 'interrupts_rate_per_sec': 152608.0,
 'soft_interrupts': 0,
 'soft_interrupts_gauge': 0,
 'syscalls': 6147415,
 'syscalls_gauge': 1345952197,
 'syscalls_rate_per_sec': 545184.0,
 'system': 12.0,
 'time_since_update': 11.275834321975708,
 'total': 32.1,
 'user': 16.8}
diskio        [OK]    0.00000s key=disk_name
[{'disk_name': 'PhysicalDrive0',
  'key': 'disk_name',
  'read_bytes': 16384,
  'read_bytes_gauge': 186827879424,
  'read_bytes_rate_per_sec': 1452.0,
  'read_count': 2,
  'read_count_gauge': 1313909,
  'read_count_rate_per_sec': 0.0,
  'time_since_update': 11.276895523071289,
  'write_bytes': 138457088,
  'write_bytes_gauge': 469759352832,
  'write_bytes_rate_per_sec': 12277943.0,
  'write_count': 140,
  'write_count_gauge': 517261,
  'write_count_rate_per_sec': 12.0}, ...]
folders       [OK]    0.00000s
[]
fs            [OK]    0.00100s key=mnt_point
[{'device_name': 'A:\\',
  'free': 12693402140672,
  'fs_type': 'NTFS',
  'key': 'mnt_point',
  'mnt_point': 'A:\\',
  'percent': 29.5,
  'size': 18000189054976,
  'used': 5306786914304}, ...]
gpu           [OK]    0.00000s
[]
help          [OK]    0.00000s
None
ip            [OK]    0.00000s
{}
irq           [OK]    0.00000s
[]
load          [OK]    0.00000s
{'cpucore': 32, 'min1': 0.4, 'min15': 0.03, 'min5': 0.1}
mem           [OK]    0.00912s
{'available': 51528966144, 'free': 51528966144, 'percent': 62.4, 'total': 137142276096, 'used': 85613309952}
memswap       [OK]    0.01779s
{'free': 34195550208,
 'percent': 0.5,
 'sin': 0,
 'sout': 0,
 'time_since_update': 11.287798881530762,
 'total': 34359738368,
 'used': 164188160}
network       [OK]    0.01369s key=interface_name
[{'alias': None,
  'bytes_all': 290353705,
  'bytes_all_gauge': 816899893223,
  'bytes_all_rate_per_sec': 25717176.0,
  'bytes_recv': 278629171,
  'bytes_recv_gauge': 790692178511,
  'bytes_recv_rate_per_sec': 24678712.0,
  'bytes_sent': 11724534,
  'bytes_sent_gauge': 26207714712,
  'bytes_sent_rate_per_sec': 1038464.0,
  'interface_name': 'Ethernet',
  'key': 'interface_name',
  'speed': 1048576000,
  'time_since_update': 11.290263891220093}, ...]
now           [OK]    0.00000s
{'custom': '2024-12-14 16:21:50 +0100', 'iso': '2024-12-14T16:21:50+01:00'}
percpu        [OK]    0.00000s key=cpu_number
[{'cpu_number': 0,
  'dpc': 9.5,
  'guest': None,
  'guest_nice': None,
  'idle': 57.0,
  'interrupt': 7.3,
  'iowait': None,
  'irq': None,
  'key': 'cpu_number',
  'nice': None,
  'softirq': None,
  'steal': None,
  'system': 19.9,
  'total': 43.0,
  'user': 6.3}, ...]
ports         [OK]    0.00100s
[]
processcount  [OK]    7.35434s
{'pid_max': 0, 'running': 388, 'sleeping': 0, 'thread': 10588, 'total': 396}
processlist   [OK]    0.00000s
[]
psutilversion [OK]    0.00000s
'6.1.0'
quicklook     [OK]    0.01898s
{'cpu': 30.8,
 'cpu_hz': 3200000000.0,
 'cpu_hz_current': 3200000000.0,
 'cpu_log_core': 32,
 'cpu_name': 'CPU',
 'cpu_phys_core': 24,
 'load': 0.1,
 'mem': 62.3,
 'percpu': [{...}, {...}, {...}, {...}, {...}, {...}, {...}, {...}, {...}, {...}, {...}, {...}, {...}, {...}, {...},
            {...}, {...}, {...}, {...}, {...}, {...}, {...}, {...}, {...}, {...}, {...}, {...}, {...}, {...}, {...},
            {...}, {...}],
 'swap': 0.5}
raid          [OK]    0.00000s
{}
sensors       [OK]    2.03907s
[]
smart         [NA]
system        [OK]    0.00000s
{'hostname': 'Hades',
 'hr_name': 'Windows 10 SP0 64bit',
 'os_name': 'Windows',
 'os_version': '10 SP0',
 'platform': '64bit'}
uptime        [OK]    0.00000s
{'seconds': 33049}
version       [OK]    0.00000s
'4.2.1'
vms           [OK]    0.00000s
[]
wifi          [OK]    0.00000s
[]
===============================================================================
Total time to update all stats: 9.46418s
===============================================================================

The entire UI and start up are slow. If I F5 the Glances tab it needs like 5-20 seconds to refresh

@nicolargo
Copy link
Owner

processcount [OK] 7.35434s
sensors [OK] 2.03907s

On my side i have:

processcount [OK] 0.06198s
sensors [OK] 0.0007s

Can not explain the reason :(

I never tested Glances on Windows 11. Is another user use this OS with Glances ?

@petapika
Copy link

petapika commented Feb 9, 2025

Niclargo, I'm also using Windows 11 Pro and have a similar issue (NPI) with initiating and getting updates from Glances to Homepage (docker widgets). Would be glad to help if I can... 

C:\Users\user>glances --issue
===============================================================================
Glances 4.3.0.8 (C:\Program Files\Python313\Lib\site-packages\glances\__init__.py)
Python 3.13.2 (C:\Program Files\Python313\python.exe)
PsUtil 6.1.1 (C:\Program Files\Python313\Lib\site-packages\psutil\__init__.py)
===============================================================================
alert         [OK]    0.00001s
[]
amps          [OK]    0.00009s
[]
cloud         [OK]    0.00004s
{}
connections   [OK]    0.04797s
{'ESTABLISHED': 60,
 'LISTEN': 57,
 'SYN_RECV': 0,
 'SYN_SENT': 4,
 'initiated': 4,
 'net_connections_enabled': True,
 'nf_conntrack_enabled': False,
 'terminated': 4}
containers    [OK]    3.27443s key=name
[{'command': 'docker-entrypoint.sh node server.js',
  'cpu_percent': 0.0,
  'created': '2025-02-04T00:06:59.909727661Z',
  'engine': 'docker',
  'id': '31d8becaf8fa84c4610fe93af3295ee86a6980c73c70371626d200a83e8d5098',
  'image': ('ghcr.io/gethomepage/homepage:latest',),
  'io_rx': None,
  'io_wx': None,
  'key': 'name',
  'memory_percent': None,
  'memory_usage': 126423040,
  'name': 'haypile-homepage',
  'network_rx': 0,
  'network_tx': 0,
  'status': 'running',
  'uptime': '21 hours'}, ...]
core          [OK]    0.00015s
{'log': 4, 'phys': 4}
cpu           [OK]    0.00061s
{'cpucore': 4,
 'ctx_switches': 511697,
 'ctx_switches_gauge': 413733541,
 'ctx_switches_rate_per_sec': 26601.0,
 'dpc': 1.0,
 'idle': 34.7,
 'interrupts': 324711,
 'interrupts_gauge': 1084426424,
 'interrupts_rate_per_sec': 16880.0,
 'soft_interrupts': 0,
 'soft_interrupts_gauge': 0,
 'syscalls': 2118349,
 'syscalls_gauge': 3075367306,
 'syscalls_rate_per_sec': 110127.0,
 'system': 40.7,
 'time_since_update': 19.235352754592896,
 'total': 69.2,
 'user': 22.2}
diskio        [OK]    0.00110s key=disk_name
[{'disk_name': 'PhysicalDrive0',
  'key': 'disk_name',
  'read_bytes': 54276608,
  'read_bytes_gauge': 610184223744,
  'read_bytes_rate_per_sec': 2821518.0,
  'read_count': 1838,
  'read_count_gauge': 11362403,
  'read_count_rate_per_sec': 95.0,
  'time_since_update': 19.236664295196533,
  'write_bytes': 20270592,
  'write_bytes_gauge': 332043010048,
  'write_bytes_rate_per_sec': 1053747.0,
  'write_count': 1208,
  'write_count_gauge': 15562868,
  'write_count_rate_per_sec': 62.0}, ...]
folders       [OK]    0.00007s
[]
fs            [OK]    0.00119s key=mnt_point
[{'device_name': 'C:\\',
  'free': 385950703616,
  'fs_type': 'NTFS',
  'key': 'mnt_point',
  'mnt_point': 'C:\\',
  'percent': 24.3,
  'size': 510015827968,
  'used': 124065124352}, ...]
gpu           [OK]    0.00042s
[]
help          [OK]    0.00012s
None
ip            [OK]    0.00007s
{}
irq           [OK]    0.00012s
[]
load          [OK]    0.00039s
{'cpucore': 4, 'min1': 3.66, 'min15': 0.29, 'min5': 0.85}
mem           [OK]    0.01512s
{'available': 4484128768, 'free': 4484128768, 'percent': 73.5, 'total': 16947015680, 'used': 12462886912}
memswap       [OK]    0.02961s
{'free': 3904622592,
 'percent': 9.4,
 'sin': 0,
 'sout': 0,
 'time_since_update': 19.519527196884155,
 'total': 4311076864,
 'used': 406454272}
network       [OK]    0.05300s key=interface_name
[{'alias': None,
  'bytes_all': 0,
  'bytes_all_gauge': 0,
  'bytes_recv': 0,
  'bytes_recv_gauge': 0,
  'bytes_sent': 0,
  'bytes_sent_gauge': 0,
  'interface_name': 'Wi-Fi 2',
  'key': 'interface_name',
  'speed': 0,
  'time_since_update': 19.51547122001648}, ...]
now           [OK]    0.00005s
{'custom': '2025-02-09 14:32:06 -0700', 'iso': '2025-02-09T14:32:06-07:00'}
percpu        [OK]    0.00015s key=cpu_number
[{'cpu_number': 0,
  'dpc': 1.0,
  'guest': None,
  'guest_nice': None,
  'idle': 31.2,
  'interrupt': 1.4,
  'iowait': None,
  'irq': None,
  'key': 'cpu_number',
  'nice': None,
  'softirq': None,
  'steal': None,
  'system': 37.7,
  'total': 68.8,
  'user': 28.8}, ...]
ports         [OK]    0.00043s
[]
processcount [OK]    13.33312s
{'pid_max': 0, 'running': 335, 'sleeping': 0, 'thread': 4776, 'total': 373}
processlist   [OK]    0.00102s
[]
programlist   [OK]    0.00739s
[]
psutilversion [OK]    0.00010s
'6.1.1'
quicklook     [OK]    0.03189s
{'cpu': 67.7,
 'cpu_hz': 800000000.0,
 'cpu_hz_current': 800000000.0,
 'cpu_log_core': 4,
 'cpu_name': 'CPU',
 'cpu_phys_core': 4,
 'load': 7.8,
 'mem': 73.7,
 'percpu': [{...}, {...}, {...}, {...}],
 'swap': 9.7}
raid          [OK]    0.00050s
{}
sensors       [OK]    2.03824s
[]
smart         [NA]
system        [OK]    0.00002s
{'hostname': 'xxxxxxxx',
 'hr_name': 'Windows 11 SP0 64bit',
 'os_name': 'Windows',
 'os_version': '11 SP0',
 'platform': '64bit'}
uptime        [OK]    0.00013s
{'seconds': 798365}
version       [OK]    0.00007s
'4.3.0.8'
vms           [OK]    0.00012s
[]
wifi          [OK]    0.00007s
[]
===============================================================================
Total time to update all stats: 19.12697s
===============================================================================**_

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants