[GH-ISSUE #5266] Windows 11上 ,ollama_llama_server.exe会被“效率模式”运行,导致响应非常慢 #29058

Closed
opened 2026-04-22 07:42:09 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @fengbangyao on GitHub (Jun 25, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/5266

Originally assigned to: @dhiltgen on GitHub.

What is the issue?

再window 11上,intel 13代cpu (目前手里的有 i5-13490F,i5-13600,应该和大小核有关,在没有小核的cpu上没有复现)运行ollama时,出现提出问题后,cpu占用40%左右,但一直没回答问题或者几分钟回答一个字。使用process lasso关闭效率模式后,正常响应。 是否可以增加一个环境变量,控制是否使用效率模式工作。

OS

Windows

GPU

Other

CPU

Intel

Ollama version

0.1.45.0 及以前

Originally created by @fengbangyao on GitHub (Jun 25, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/5266 Originally assigned to: @dhiltgen on GitHub. ### What is the issue? 再window 11上,intel 13代cpu (目前手里的有 i5-13490F,i5-13600,应该和大小核有关,在没有小核的cpu上没有复现)运行ollama时,出现提出问题后,cpu占用40%左右,但一直没回答问题或者几分钟回答一个字。使用process lasso关闭效率模式后,正常响应。 是否可以增加一个环境变量,控制是否使用效率模式工作。 ### OS Windows ### GPU Other ### CPU Intel ### Ollama version 0.1.45.0 及以前
GiteaMirror added the bugwindows labels 2026-04-22 07:42:10 -05:00
Author
Owner

@dhiltgen commented on GitHub (Jun 25, 2024):

This may be a dup of #3511 - it appears there are some scenarios where laptops put Ollama in efficiency mode, which results in very poor performance. You should be able to workaround this in Task Manager by selecting the ollama processes and making sure they don't have the green leaf/efficiency mode selected.

<!-- gh-comment-id:2189372956 --> @dhiltgen commented on GitHub (Jun 25, 2024): This may be a dup of #3511 - it appears there are some scenarios where laptops put Ollama in efficiency mode, which results in very poor performance. You should be able to workaround this in Task Manager by selecting the ollama processes and making sure they don't have the green leaf/efficiency mode selected.
Author
Owner

@fengbangyao commented on GitHub (Jun 27, 2024):

Thank you for your attention ^.^
Yes, indeed, it's the efficiency mode that's causing the issue. , and it's not exclusive to laptops; I'm using a desktop.What I mean is, will the official team provide command-line support for this issue? For instance, Chrome or Edge already supports command-line control with --disable-features=UseEcoQoSForBackgroundProcess. I don't know the Go language, and the Chromium code is as follows:

bool Process::SetPriority(Priority priority) {
  DCHECK(IsValid());
  // Having a process remove itself from background mode is a potential
  // priority inversion, and having a process put itself in background mode is
  // broken in Windows 11 22H2. So, it is no longer supported. See
  // https://crbug.com/1396155 for details.
  DCHECK(!is_current());
  const DWORD priority_class = priority == Priority::kBestEffort
                                   ? IDLE_PRIORITY_CLASS
                                   : NORMAL_PRIORITY_CLASS;

  if (base::win::OSInfo::GetInstance()->version() >=
          base::win::Version::WIN11 &&
      FeatureList::IsEnabled(kUseEcoQoSForBackgroundProcess)) {
    PROCESS_POWER_THROTTLING_STATE power_throttling;
    RtlZeroMemory(&power_throttling, sizeof(power_throttling));
    power_throttling.Version = PROCESS_POWER_THROTTLING_CURRENT_VERSION;

    if (priority == Priority::kBestEffort) {
      // Sets Eco QoS level.
      power_throttling.ControlMask = PROCESS_POWER_THROTTLING_EXECUTION_SPEED;
      power_throttling.StateMask = PROCESS_POWER_THROTTLING_EXECUTION_SPEED;
    } else {
      // Uses system default.
      power_throttling.ControlMask = 0;
      power_throttling.StateMask = 0;
    }
    bool ret =
        ::SetProcessInformation(Handle(), ProcessPowerThrottling,
                                &power_throttling, sizeof(power_throttling));
    if (ret == 0) {
      DPLOG(ERROR) << "Setting process QoS policy fails";
    }
  }

  return (::SetPriorityClass(Handle(), priority_class) != 0);
}

ollama.exe set ollama_llama_server.exe

<!-- gh-comment-id:2193251000 --> @fengbangyao commented on GitHub (Jun 27, 2024): Thank you for your attention ^.^ Yes, indeed, it's the efficiency mode that's causing the issue. , and it's not exclusive to laptops; I'm using a desktop.What I mean is, will the official team provide command-line support for this issue? For instance, Chrome or Edge already supports command-line control with --disable-features=UseEcoQoSForBackgroundProcess. I don't know the Go language, and the Chromium code is as follows: ``` bool Process::SetPriority(Priority priority) { DCHECK(IsValid()); // Having a process remove itself from background mode is a potential // priority inversion, and having a process put itself in background mode is // broken in Windows 11 22H2. So, it is no longer supported. See // https://crbug.com/1396155 for details. DCHECK(!is_current()); const DWORD priority_class = priority == Priority::kBestEffort ? IDLE_PRIORITY_CLASS : NORMAL_PRIORITY_CLASS; if (base::win::OSInfo::GetInstance()->version() >= base::win::Version::WIN11 && FeatureList::IsEnabled(kUseEcoQoSForBackgroundProcess)) { PROCESS_POWER_THROTTLING_STATE power_throttling; RtlZeroMemory(&power_throttling, sizeof(power_throttling)); power_throttling.Version = PROCESS_POWER_THROTTLING_CURRENT_VERSION; if (priority == Priority::kBestEffort) { // Sets Eco QoS level. power_throttling.ControlMask = PROCESS_POWER_THROTTLING_EXECUTION_SPEED; power_throttling.StateMask = PROCESS_POWER_THROTTLING_EXECUTION_SPEED; } else { // Uses system default. power_throttling.ControlMask = 0; power_throttling.StateMask = 0; } bool ret = ::SetProcessInformation(Handle(), ProcessPowerThrottling, &power_throttling, sizeof(power_throttling)); if (ret == 0) { DPLOG(ERROR) << "Setting process QoS policy fails"; } } return (::SetPriorityClass(Handle(), priority_class) != 0); } ``` ollama.exe set ollama_llama_server.exe
Author
Owner

@dhiltgen commented on GitHub (Jul 5, 2024):

Let's track this in #3511

<!-- gh-comment-id:2211368104 --> @dhiltgen commented on GitHub (Jul 5, 2024): Let's track this in #3511
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#29058