Kong / insomnia

The open-source, cross-platform API client for GraphQL, REST, WebSockets, SSE and gRPC. With Cloud, Local and Git storage.
https://insomnia.rest
Apache License 2.0
34.39k stars 1.94k forks source link

[Bug] Insomnia Helper CPU up to 50% while Idle #2015

Open stephanoparaskeva opened 4 years ago

stephanoparaskeva commented 4 years ago

Describe the bug

CPU Usage rises to 50% max sometimes while insomnia is Idle, and Insomnia Helper is to blame in activity monitor. Tanked my performance in editor.

Specs Macbook Pro Catalina i7 4cores 2.8ghz

Insomnia Version: latest Plugins: 1 plugin 'insomnia-plugin-default-headers' Account: none

not logged in on insomnia at all

gschier commented 4 years ago

Can you post a screenshot of activity monitor? This is what I'm getting

image

Can you try backing up app data and seeing if it happens in a fresh install too? It could be request or response data causing issues.

  1. Local app data folder from Help > Show AppData Folder
  2. Rename (backup) folder to something else so you don't lose it
  3. Relaunch Insomnia
  4. When done testing, put backed-up folder back where it was
stephanoparaskeva commented 4 years ago

I've done a fresh install, problem hasn't re-occurred since rebooting laptop. Didn't manage to screenshot activity. Got a feeling it will happen again so when it does will post here.

stephanoparaskeva commented 4 years ago

@gschier Here insomnia helper is only using 6%, but I think there is a leak somewhere as I'm sure Insomnia is requesting high CPU usage from the system and being stopped by kernal_task which then runs many threads and causes laptop to overheat.

Screenshot 2020-04-03 at 01 47 50

It obviously looks like nothing but CPU was sitting at 100 degrees. I'm sure there's something up

Next here is a picture of insomnia jumping to 67% of CPU right after.

Screenshot 2020-04-03 at 01 52 22

78%

Screenshot 2020-04-03 at 02 02 06

memory

Screenshot 2020-04-03 at 02 01 46

Not logged in at all, minimal settings, only 8 folders of requests with 4 requests per folder, not currently making any requests and it's in the background. CPU usage reached up to 114% at one point

stephanoparaskeva commented 4 years ago

@gschier Hey, this is happening non-stop. Any Updates?

anotheri commented 4 years ago

Same here but when I pulling from git, restart app helps, but I have to do it all the time

adhatama commented 4 years ago

This is happening to me as well. Idle Insomnia getting a high CPU and need restart to fix. I'm not sure maybe it's happening after getting back from Sleep.

Shawyeok commented 3 years ago

Same problem here, high cpu usage up to 120% when idle.

Process Name: Insomnia Helper (Renderer)

$ top -pid 50346 -l 10
Processes: 554 total, 2 running, 552 sleeping, 3072 threads 
2020/11/18 15:23:37
Load Avg: 1.77, 1.93, 2.00 
CPU usage: 6.82% user, 12.55% sys, 80.62% idle 
SharedLibs: 299M resident, 70M data, 30M linkedit.
MemRegions: 401500 total, 5077M resident, 125M private, 2164M shared.
PhysMem: 15G used (4181M wired), 1029M unused.
VM: 4321G vsize, 1993M framework vsize, 507636231(0) swapins, 517209658(0) swapouts.
Networks: packets: 192770749/183G in, 260977002/167G out.
Disks: 150480212/3526G read, 49715489/2663G written.

PID    COMMAND          %CPU TIME     #TH #WQ #PORTS MEM   PURG CMPRS PGRP  PPID  STATE    BOOSTS %CPU_ME %CPU_OTHRS UID FAULTS    COW    MSGSENT   MSGRECV   SYSBSD    SYSMACH   CSW       PAGEINS IDLEW    POWER INSTRS CYCLES USER   #MREGS RPRVT VPRVT VSIZE KPRVT KSHRD
50346  Insomnia Helper  0.0  37:30:20 26  1   200    1479M 0B   88M   50332 50332 sleeping *0[82] 0.00000 0.00000    502 355107803 141298 251755688 131953874 167329271 398473805 162343637 49180   13037801 0.0   0      0      docker N/A    N/A   N/A   N/A   N/A   N/A  
Processes: 554 total, 3 running, 551 sleeping, 3091 threads 
2020/11/18 15:23:39
Load Avg: 1.77, 1.93, 2.00 
CPU usage: 5.61% user, 5.21% sys, 89.17% idle 
SharedLibs: 299M resident, 70M data, 30M linkedit.
MemRegions: 401500 total, 5077M resident, 125M private, 2164M shared.
PhysMem: 15G used (4172M wired), 1024M unused.
VM: 4321G vsize, 1993M framework vsize, 507636295(64) swapins, 517209658(0) swapouts.
Networks: packets: 192770855/183G in, 260977094/167G out.
Disks: 150480213/3526G read, 49715494/2663G written.

PID    COMMAND          %CPU TIME     #TH #WQ #PORTS MEM    PURG CMPRS PGRP  PPID  STATE    BOOSTS %CPU_ME %CPU_OTHRS UID FAULTS     COW    MSGSENT    MSGRECV    SYSBSD     SYSMACH    CSW        PAGEINS IDLEW     POWER INSTRS     CYCLES     USER   #MREGS RPRVT VPRVT VSIZE KPRVT KSHRD
50346  Insomnia Helper  19.5 37:30:20 26  1   200    1483M+ 0B   88M   50332 50332 sleeping *0[82] 0.00000 0.00000    502 355110498+ 141298 251756859+ 131954513+ 167329333+ 398496375+ 162343775+ 49180   13037816+ 19.8  1064177819 1218213930 docker N/A    N/A   N/A   N/A   N/A   N/A  
Processes: 554 total, 4 running, 550 sleeping, 3136 threads 
2020/11/18 15:23:40
Load Avg: 1.77, 1.93, 2.00 
CPU usage: 10.9% user, 6.32% sys, 83.57% idle 
SharedLibs: 299M resident, 70M data, 30M linkedit.
MemRegions: 401500 total, 5077M resident, 125M private, 2164M shared.
PhysMem: 15G used (4177M wired), 975M unused.
VM: 4321G vsize, 1993M framework vsize, 507639738(3443) swapins, 517209658(0) swapouts.
Networks: packets: 192771024/183G in, 260977241/167G out.
Disks: 150480282/3526G read, 49715494/2663G written.

PID    COMMAND          %CPU TIME     #TH  #WQ #PORTS MEM    PURG CMPRS PGRP  PPID  STATE    BOOSTS %CPU_ME %CPU_OTHRS UID FAULTS     COW    MSGSENT    MSGRECV    SYSBSD     SYSMACH    CSW        PAGEINS IDLEW     POWER INSTRS     CYCLES     USER   #MREGS RPRVT VPRVT VSIZE KPRVT KSHRD
50346  Insomnia Helper  32.9 37:30:20 26/1 1   200    1514M+ 0B   88M   50332 50332 running  *0[82] 0.00000 0.00000    502 355119039+ 141298 251757795+ 131954998+ 167329466+ 398513668+ 162344041+ 49180   13037839+ 33.9  1017141093 1122768741 docker N/A    N/A   N/A   N/A   N/A   N/A  
Processes: 554 total, 2 running, 552 sleeping, 3200 threads 
2020/11/18 15:23:41
Load Avg: 1.77, 1.93, 2.00 
CPU usage: 10.59% user, 8.90% sys, 80.49% idle 
SharedLibs: 299M resident, 70M data, 30M linkedit.
MemRegions: 401500 total, 5077M resident, 125M private, 2164M shared.
PhysMem: 15G used (4240M wired), 915M unused.
VM: 4321G vsize, 1993M framework vsize, 507644453(4715) swapins, 517209658(0) swapouts.
Networks: packets: 192771150/183G in, 260977354/167G out.
Disks: 150480394/3526G read, 49715990/2663G written.

PID    COMMAND          %CPU TIME     #TH  #WQ #PORTS MEM    PURG CMPRS PGRP  PPID  STATE    BOOSTS %CPU_ME %CPU_OTHRS UID FAULTS     COW    MSGSENT    MSGRECV    SYSBSD     SYSMACH    CSW        PAGEINS IDLEW     POWER INSTRS     CYCLES     USER   #MREGS RPRVT VPRVT VSIZE KPRVT KSHRD
50346  Insomnia Helper  29.1 37:30:21 26   1   200    1518M+ 0B   88M   50332 50332 sleeping *0[82] 0.00000 0.00000    502 355119997+ 141298 251758536+ 131955711+ 167329500+ 398533555+ 162345205+ 49180   13038082+ 39.8  795758649  976515598  docker N/A    N/A   N/A   N/A   N/A   N/A  
Processes: 554 total, 4 running, 550 sleeping, 3203 threads 
2020/11/18 15:23:42
Load Avg: 1.77, 1.93, 2.00 
CPU usage: 9.1% user, 5.97% sys, 85.0% idle 
SharedLibs: 299M resident, 70M data, 30M linkedit.
MemRegions: 401500 total, 5077M resident, 125M private, 2164M shared.
PhysMem: 15G used (4215M wired), 894M unused.
VM: 4321G vsize, 1993M framework vsize, 507647433(2980) swapins, 517209658(0) swapouts.
Networks: packets: 192771277/183G in, 260977483/167G out.
Disks: 150480446/3526G read, 49715992/2663G written.

PID    COMMAND          %CPU TIME     #TH  #WQ #PORTS MEM    PURG CMPRS PGRP  PPID  STATE    BOOSTS %CPU_ME %CPU_OTHRS UID FAULTS     COW    MSGSENT    MSGRECV    SYSBSD     SYSMACH    CSW        PAGEINS IDLEW     POWER INSTRS     CYCLES     USER   #MREGS RPRVT VPRVT VSIZE KPRVT KSHRD
50346  Insomnia Helper  27.7 37:30:21 26/1 1   203+   1521M+ 0B   88M-  50332 50332 running  *0[82] 0.00000 0.00000    502 355120912+ 141298 251759527+ 131956214+ 167329627+ 398549569+ 162345710+ 49180   13038134+ 30.0  761746797  904246709  docker N/A    N/A   N/A   N/A   N/A   N/A  
Processes: 554 total, 3 running, 551 sleeping, 3215 threads 
2020/11/18 15:23:43
Load Avg: 1.71, 1.91, 1.99 
CPU usage: 12.81% user, 7.70% sys, 79.47% idle 
SharedLibs: 299M resident, 70M data, 30M linkedit.
MemRegions: 401500 total, 5077M resident, 125M private, 2164M shared.
PhysMem: 15G used (4253M wired), 861M unused.
VM: 4321G vsize, 1993M framework vsize, 507649285(1852) swapins, 517209658(0) swapouts.
Networks: packets: 192771405/183G in, 260977616/167G out.
Disks: 150480480/3526G read, 49715995/2663G written.

PID    COMMAND          %CPU TIME     #TH  #WQ #PORTS MEM    PURG CMPRS PGRP  PPID  STATE    BOOSTS %CPU_ME %CPU_OTHRS UID FAULTS     COW    MSGSENT    MSGRECV    SYSBSD     SYSMACH    CSW        PAGEINS IDLEW     POWER INSTRS     CYCLES     USER   #MREGS RPRVT VPRVT VSIZE KPRVT KSHRD
50346  Insomnia Helper  39.3 37:30:21 26   1   203    1526M+ 0B   88M   50332 50332 sleeping *0[82] 0.00000 0.00000    502 355124054+ 141298 251760646+ 131956737+ 167329933+ 398566011+ 162346718+ 49180   13038150+ 40.0  1066273416 1256623519 docker N/A    N/A   N/A   N/A   N/A   N/A  
Processes: 554 total, 5 running, 549 sleeping, 3236 threads 
2020/11/18 15:23:44
Load Avg: 1.71, 1.91, 1.99 
CPU usage: 14.75% user, 8.74% sys, 76.50% idle 
SharedLibs: 299M resident, 70M data, 30M linkedit.
MemRegions: 401500 total, 5077M resident, 125M private, 2164M shared.
PhysMem: 15G used (4269M wired), 827M unused.
VM: 4321G vsize, 1993M framework vsize, 507652593(3308) swapins, 517209658(0) swapouts.
Networks: packets: 192771507/183G in, 260977718/167G out.
Disks: 150480554/3526G read, 49716004/2663G written.

PID    COMMAND          %CPU TIME     #TH  #WQ #PORTS MEM    PURG CMPRS PGRP  PPID  STATE    BOOSTS %CPU_ME %CPU_OTHRS UID FAULTS     COW    MSGSENT    MSGRECV    SYSBSD     SYSMACH    CSW        PAGEINS IDLEW     POWER INSTRS     CYCLES     USER   #MREGS RPRVT VPRVT VSIZE KPRVT KSHRD
50346  Insomnia Helper  41.7 37:30:22 26/1 1   200-   1532M+ 0B   88M   50332 50332 running  *0[82] 0.00000 0.00000    502 355125653+ 141298 251761966+ 131957787+ 167330452+ 398589478+ 162348917+ 49180   13038528+ 58.9  1211922572 1477731616 docker N/A    N/A   N/A   N/A   N/A   N/A  
Processes: 555 total, 3 running, 552 sleeping, 3182 threads 
2020/11/18 15:23:45
Load Avg: 1.71, 1.91, 1.99 
CPU usage: 9.41% user, 7.25% sys, 83.33% idle 
SharedLibs: 299M resident, 70M data, 30M linkedit.
MemRegions: 401785 total, 5094M resident, 125M private, 2164M shared.
PhysMem: 15G used (4269M wired), 800M unused.
VM: 4329G vsize, 1993M framework vsize, 507653291(698) swapins, 517209658(0) swapouts.
Networks: packets: 192771659/183G in, 260977860/167G out.
Disks: 150480587/3526G read, 49716007/2663G written.

PID    COMMAND          %CPU TIME     #TH  #WQ #PORTS MEM    PURG CMPRS PGRP  PPID  STATE    BOOSTS %CPU_ME %CPU_OTHRS UID FAULTS     COW    MSGSENT    MSGRECV    SYSBSD     SYSMACH    CSW        PAGEINS IDLEW     POWER INSTRS     CYCLES     USER   #MREGS RPRVT VPRVT VSIZE KPRVT KSHRD
50346  Insomnia Helper  25.0 37:30:22 26   1   200    1535M+ 0B   88M   50332 50332 sleeping *0[82] 0.00000 0.00000    502 355126537+ 141298 251762738+ 131958285+ 167330483+ 398606753+ 162349594+ 49180   13038669+ 31.4  722255248  885064700  docker N/A    N/A   N/A   N/A   N/A   N/A  
Processes: 555 total, 3 running, 552 sleeping, 3183 threads 
2020/11/18 15:23:46
Load Avg: 1.71, 1.91, 1.99 
CPU usage: 9.22% user, 6.60% sys, 84.16% idle 
SharedLibs: 299M resident, 70M data, 30M linkedit.
MemRegions: 401785 total, 5094M resident, 125M private, 2164M shared.
PhysMem: 15G used (4273M wired), 790M unused.
VM: 4329G vsize, 1993M framework vsize, 507654122(831) swapins, 517209658(0) swapouts.
Networks: packets: 192771763/183G in, 260977962/167G out.
Disks: 150480606/3526G read, 49716625/2663G written.

PID    COMMAND          %CPU TIME     #TH  #WQ #PORTS MEM    PURG CMPRS PGRP  PPID  STATE    BOOSTS %CPU_ME %CPU_OTHRS UID FAULTS     COW    MSGSENT    MSGRECV    SYSBSD     SYSMACH    CSW        PAGEINS IDLEW     POWER INSTRS     CYCLES     USER   #MREGS RPRVT VPRVT VSIZE KPRVT KSHRD
50346  Insomnia Helper  27.1 37:30:22 26/1 1   200    1539M+ 0B   88M   50332 50332 running  *0[82] 0.00000 0.00000    502 355127428+ 141298 251763677+ 131958762+ 167330513+ 398623178+ 162350038+ 49180   13038706+ 28.8  744555329  901156996  docker N/A    N/A   N/A   N/A   N/A   N/A  
Processes: 555 total, 2 running, 553 sleeping, 3183 threads 
2020/11/18 15:23:47
Load Avg: 1.65, 1.90, 1.99 
CPU usage: 6.78% user, 5.99% sys, 87.21% idle 
SharedLibs: 299M resident, 70M data, 30M linkedit.
MemRegions: 401785 total, 5094M resident, 125M private, 2164M shared.
PhysMem: 15G used (4272M wired), 815M unused.
VM: 4329G vsize, 1993M framework vsize, 507654441(319) swapins, 517209658(0) swapouts.
Networks: packets: 192771930/183G in, 260978123/167G out.
Disks: 150480611/3526G read, 49716630/2663G written.

PID    COMMAND          %CPU TIME     #TH  #WQ #PORTS MEM    PURG CMPRS PGRP  PPID  STATE    BOOSTS %CPU_ME %CPU_OTHRS UID FAULTS     COW    MSGSENT    MSGRECV    SYSBSD     SYSMACH    CSW        PAGEINS IDLEW     POWER INSTRS     CYCLES     USER   #MREGS RPRVT VPRVT VSIZE KPRVT KSHRD
50346  Insomnia Helper  31.0 37:30:23 26   1   200    1513M- 0B   88M   50332 50332 sleeping *0[82] 0.00000 0.00000    502 355128326+ 141298 251764689+ 131959540+ 167330560+ 398643763+ 162350793+ 49180   13038907+ 40.1  862579992  1031483586 docker N/A    N/A   N/A   N/A   N/A   N/A  
Shawyeok commented 3 years ago

image The process keep holding these file descriptors which the corresponding files are empty, problem hasn't re-occurred since I deleted those files and restarted insomnia.

$ cd "$HOME/Library/Application Support/Insomnia/responses/"
$ ls -sl | awk '$6==0 {print $NF}' | xargs rm

image

develohpanda commented 3 years ago

Wow thanks @Shawyeok, that's quite useful. Those files are used for Insomnia's response history, I wonder if they are being cleared correctly. There is a setting in the user preferences to control how much response history is stored, it's possible that Insomnia isn't releasing those files.

Does this ring any bells relating to how you are using Insomnia? Are you restarting the app infrequently, or making many requests, etc?

Shawyeok commented 3 years ago

Wow thanks @Shawyeok, that's quite useful. Those files are used for Insomnia's response history, I wonder if they are being cleared correctly. There is a setting in the user preferences to control how much response history is stored, it's possible that Insomnia isn't releasing those files.

Does this ring any bells relating to how you are using Insomnia? Are you restarting the app infrequently, or making many requests, etc?

Response History Limit: 20

I rarely restart the insomnia app as well as os unless I have to do, e.g. app/system upgrade, my system is up for 25 days until now.

making many requests

Depends on what's many, now I have 3000+ files with .response and .timeline suffixes in responses folder.

develohpanda commented 3 years ago

Very useful information - both not restarting the app often and how many files you have in there. Each .response file represents one response, so even if the history limit is limited to 20, and like you mentioned most of the files are empty, there could still be a lock/hold on the file at an OS level.

Judging by the other comments in this thread, if you were to simply restart the app and not delete the files, you should have seem performance come back to normal, which certainly sounds like a memory leak in the response handling.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.