Duplicati.GUI.TrayIcon.exe high CPU usage on Windows Server 2012R2

Hi.

It looks like Duplicati is slowing down my old Windows Server 2012R2, I see allwais arround 25% CPU usage for the Duplicati.GUI.TrayIcon.exe process (all backups idle). I’m on 2.1.0.5_stable_2025-03-04

Restarting or compacting doesn’t help, any advices?

Hi @Xabier_Hualde, welcome to the forum :waving_hand:

Do you see any logs anywhere?

Either the Windows eventlogs, or inside Duplicati, go to “About” → “Logs” → “Live logs” and choose “Verbose”.

1 Like

I see many .NET errors on eventlogs on Duplicati launch:

Nombre de registro:Application
Origen:        .NET Runtime
Fecha:         10/07/2025 8:28:36
Id. del evento:1000
Categoría de la tarea:Ninguno
Nivel:         Error
Palabras clave:Clásico
Usuario:       No disponible
Equipo:        SRVEMN
Descripción:
Category: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware
EventId: 1
SpanId: 20233fa009de832b
TraceId: ca00571de389340256eeb044a4450b6e
ParentId: 0000000000000000
ConnectionId: 0HNDVFBKA17I6
RequestId: 0HNDVFBKA17I6:00000001
RequestPath: /api/v1/auth/refresh

An unhandled exception has occurred while executing the request.

Exception: 
Duplicati.WebserverCore.Exceptions.UnauthorizedException: Failed to refresh token
   at Duplicati.WebserverCore.Endpoints.V1.Auth.<>c.<<Map>b__3_0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Http.RequestDelegateFactory.<TaskOfTToValueTaskOfObject>g__ExecuteAwaited|92_0[T](Task`1 task)
   at Duplicati.WebserverCore.Middlewares.HostnameFilter.InvokeAsync(EndpointFilterInvocationContext context, EndpointFilterDelegate next)
   at Duplicati.WebserverCore.Middlewares.LanguageFilter.InvokeAsync(EndpointFilterInvocationContext context, EndpointFilterDelegate next)
   at Microsoft.AspNetCore.Http.RequestDelegateFactory.<ExecuteValueTaskOfObject>g__ExecuteAwaited|129_0(ValueTask`1 valueTask, HttpContext httpContext, JsonTypeInfo`1 jsonTypeInfo)
   at Duplicati.WebserverCore.Middlewares.WebsocketExtensions.<>c__DisplayClass0_0.<<UseNotifications>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.<Invoke>g__Awaited|10_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)

XML de evento:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name=".NET Runtime" />
    <EventID Qualifiers="0">1000</EventID>
    <Level>2</Level>
    <Task>0</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2025-07-10T06:28:36.000000000Z" />
    <EventRecordID>616268</EventRecordID>
    <Channel>Application</Channel>
    <Computer>SRVEMN</Computer>
    <Security />
  </System>
  <EventData>
    <Data>Category: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware
EventId: 1
SpanId: 20233fa009de832b
TraceId: ca00571de389340256eeb044a4450b6e
ParentId: 0000000000000000
ConnectionId: 0HNDVFBKA17I6
RequestId: 0HNDVFBKA17I6:00000001
RequestPath: /api/v1/auth/refresh

An unhandled exception has occurred while executing the request.

Exception: 
Duplicati.WebserverCore.Exceptions.UnauthorizedException: Failed to refresh token
   at Duplicati.WebserverCore.Endpoints.V1.Auth.&lt;&gt;c.&lt;&lt;Map&gt;b__3_0&gt;d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Http.RequestDelegateFactory.&lt;TaskOfTToValueTaskOfObject&gt;g__ExecuteAwaited|92_0[T](Task`1 task)
   at Duplicati.WebserverCore.Middlewares.HostnameFilter.InvokeAsync(EndpointFilterInvocationContext context, EndpointFilterDelegate next)
   at Duplicati.WebserverCore.Middlewares.LanguageFilter.InvokeAsync(EndpointFilterInvocationContext context, EndpointFilterDelegate next)
   at Microsoft.AspNetCore.Http.RequestDelegateFactory.&lt;ExecuteValueTaskOfObject&gt;g__ExecuteAwaited|129_0(ValueTask`1 valueTask, HttpContext httpContext, JsonTypeInfo`1 jsonTypeInfo)
   at Duplicati.WebserverCore.Middlewares.WebsocketExtensions.&lt;&gt;c__DisplayClass0_0.&lt;&lt;UseNotifications&gt;b__0&gt;d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.&lt;Invoke&gt;g__Awaited|10_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)
</Data>
  </EventData>
</Event>






Nombre de registro:Application
Origen:        .NET Runtime
Fecha:         10/07/2025 8:28:36
Id. del evento:1000
Categoría de la tarea:Ninguno
Nivel:         Error
Palabras clave:Clásico
Usuario:       No disponible
Equipo:        SRVEMN
Descripción:
Category: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware
EventId: 1
SpanId: 8e6f1e739ac5f07c
TraceId: f6ac8955875f64db46cc11657f1b03f1
ParentId: 0000000000000000
ConnectionId: 0HNDVFBKA17I4
RequestId: 0HNDVFBKA17I4:00000002
RequestPath: /api/v1/auth/refresh

An unhandled exception has occurred while executing the request.

Exception: 
Duplicati.WebserverCore.Exceptions.UnauthorizedException: Failed to refresh token
   at Duplicati.WebserverCore.Endpoints.V1.Auth.<>c.<<Map>b__3_0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Http.RequestDelegateFactory.<TaskOfTToValueTaskOfObject>g__ExecuteAwaited|92_0[T](Task`1 task)
   at Duplicati.WebserverCore.Middlewares.HostnameFilter.InvokeAsync(EndpointFilterInvocationContext context, EndpointFilterDelegate next)
   at Duplicati.WebserverCore.Middlewares.LanguageFilter.InvokeAsync(EndpointFilterInvocationContext context, EndpointFilterDelegate next)
   at Microsoft.AspNetCore.Http.RequestDelegateFactory.<ExecuteValueTaskOfObject>g__ExecuteAwaited|129_0(ValueTask`1 valueTask, HttpContext httpContext, JsonTypeInfo`1 jsonTypeInfo)
   at Duplicati.WebserverCore.Middlewares.WebsocketExtensions.<>c__DisplayClass0_0.<<UseNotifications>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.<Invoke>g__Awaited|10_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)

XML de evento:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name=".NET Runtime" />
    <EventID Qualifiers="0">1000</EventID>
    <Level>2</Level>
    <Task>0</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2025-07-10T06:28:36.000000000Z" />
    <EventRecordID>616269</EventRecordID>
    <Channel>Application</Channel>
    <Computer>SRVEMN</Computer>
    <Security />
  </System>
  <EventData>
    <Data>Category: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware
EventId: 1
SpanId: 8e6f1e739ac5f07c
TraceId: f6ac8955875f64db46cc11657f1b03f1
ParentId: 0000000000000000
ConnectionId: 0HNDVFBKA17I4
RequestId: 0HNDVFBKA17I4:00000002
RequestPath: /api/v1/auth/refresh

An unhandled exception has occurred while executing the request.

Exception: 
Duplicati.WebserverCore.Exceptions.UnauthorizedException: Failed to refresh token
   at Duplicati.WebserverCore.Endpoints.V1.Auth.&lt;&gt;c.&lt;&lt;Map&gt;b__3_0&gt;d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Http.RequestDelegateFactory.&lt;TaskOfTToValueTaskOfObject&gt;g__ExecuteAwaited|92_0[T](Task`1 task)
   at Duplicati.WebserverCore.Middlewares.HostnameFilter.InvokeAsync(EndpointFilterInvocationContext context, EndpointFilterDelegate next)
   at Duplicati.WebserverCore.Middlewares.LanguageFilter.InvokeAsync(EndpointFilterInvocationContext context, EndpointFilterDelegate next)
   at Microsoft.AspNetCore.Http.RequestDelegateFactory.&lt;ExecuteValueTaskOfObject&gt;g__ExecuteAwaited|129_0(ValueTask`1 valueTask, HttpContext httpContext, JsonTypeInfo`1 jsonTypeInfo)
   at Duplicati.WebserverCore.Middlewares.WebsocketExtensions.&lt;&gt;c__DisplayClass0_0.&lt;&lt;UseNotifications&gt;b__0&gt;d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.&lt;Invoke&gt;g__Awaited|10_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)
</Data>
  </EventData>
</Event>

And more similar errors.

On Duplicati Logs I see this every minute:

10 de jul. de 2025 8:20: Received message from server: eyJhbGciOiJSU0EtT0FFUC0yNTYiLCJlbmMiOiJBMjU2Q0JDLUhTNTEyIiwiZW5jcnlwdGVkIjoidHJ1ZSIsInZlcnNpb24iOiIxIn0.DdeUlgUCF0m9CFOHptlXcUz65UWfwZcZLuj-m9W0hG93gDckQ25CErJxVqUVD0VkQz8ILxCdubLgHfZSPbLpngMnHHxfzaM5cNRL6XihITOt9f65j1yi3HUnuzDY-uXeYaKhrEdOn-EnStzvFn9qHxhpD7RifhP7ulgZHF_NZRXnHCASWYRaTlx2LdJDw0_yYJTeKGisXryAonbIMGYBsiBqUCDD8yy_JRqKUb30IZAdN4L0tAy_4gR4SI7rkIhSV6XjdaghLg2x0_nss5Kf-qY9mhtN7lgKW_eqMC7I98aCoA-a_FH_lPz_miE00jx8peDQZNMKSf-U3JaPSnLRiA.LmTqnyuLrsjcG0LwXiL_zQ.Gk87RMz0YVCcaQDT-HG8s4OOWZHgXiRJDfcUo381pAsRmbQtprSJunHIAy4dlNCKVEDiEia6iTbWsO85pUMleJJYSnyuq_XheX2f9lRQ7KF_P-83-wFLZxmfSGURuO-TNBNDiuPrMVgyPvxaR36L8AmioUxSyX9Sc1hkbly3jJPVBw7AHexSpDhxMZOK1twBAFE2fNyZrUOWfW5otwbYjDrXva0PgWkvLlME6znTUOw.5M_kXbXAsGwGgLQCuy_VRr9Hw2BLVOsfsiXPc_ONG-s

This part means that something is calling the UI with an invalid (most likely expired) token.
The two examples here seems to have the same timestamp. Is there some browser open that keeps hammering the server with an invalid token?

This is from the remote management feature. Each (encrypted) message is logged, and what you see there is a heartbeat message. The logging of this has been removed in the canary builds as it has no value in the logs.

Is there some browser open that keeps hammering the server with an invalid token?

Yes it was, but after removing it and restarting this was not the problem with the CPU usage.

I think I have found a workarround: If I run Duplicati.Server.exe instead of Duplicati.GUI.TrayIcon.exe, it runs with 0%CPU and I can still see the WEB-UI, obviously I have no trayicon but I don’t need it. Is there any drawback to working this way?

I think this indicates that the TrayIcon is the culprit? Internally, it makes a connection to the server, and keeps it open. There should be almost no activity here, but maybe something is causing it to retry or something similar.

No, that is exactly the same, except the icon is not there.

1 Like

Was it the problem with the frequent event log errors, or is it now high-CPU low-event?

A TrayIcon is a combination of the visible icon and Server hosted in the same process, making it hard to tell which piece is using up CPU. One can also start TrayIcon using:

--no-hosted-server: Set this option to not spawn a local service, use if the TrayIcon should connect to a running service

Ordinarily, one would use this with the Windows service launching the Server, but it will function with any Server AFAIK, so you can then try to separate out what’s taking CPU.

I asked a question to try to clarify previous hammering, but might Avalonia be breaking?

It is possible there is some thread running full speed, but that is harder to debug.