Jump to content
View in the app

A better way to browse. Learn more.

The Uniform Server Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Feature Request: enable apache, mysql & php-cgi to be executed with enhanced process priority

Featured Replies

Background: I'm tuning a UniServer hosted WebApp and WebAPI, running on Windows Server 2008 R2. Via the Task Manager, I experimented with setting the process priority for apache, mysql & php-cgi to "Above Normal" and saw complex processing task execution times reduce by 30%. This is quite significant.

 

I have successfully rewritten php logic in my WebApp where it launches separate "worker" executables to launch it's WebApp processes at high priority:

pclose(popen('start /B /HIGH '.$cmd, 'r' )); // $cmd is the command line to launch my worker exe

Additionally, I've tried the following "Windows PowerShell" script to modify the running apache, mysql & php-cgi processes:

get-process -processname httpd1 | foreach { $_.PriorityClass = "AboveNormal" }

get-process -processname mysqld1 | foreach { $_.PriorityClass = "AboveNormal" }

get-process -processname php-cgi | foreach { $_.PriorityClass = "AboveNormal" }

This Windows PowerShell script works, but only when executed interactively. I tried executing this from within the WebApp, but it silently does nothing. :)

 

I took a brief look at the UniServer's "start_as_service.exe" -> "About", and that seems to indicate the "start_as_service.exe" is written in VBA. So, perhaps a variant of this logic could be inserted or added to enable the UniServer's key executables to run with enhanced priority?

 

/* only an example, uniServer version would be affect apache, mysql & php-cgi, with uniServer-admin specified priorities */
Private Sub ProcessIdle()  
Dim psList() As Process
If Process.GetProcessesByName("hl").Length = 0 Then
  Me.Text = "Waiting for hl.exe"
Else
  Try
	psList = Process.GetProcesses()
	For Each p As Process In psList
	  If p.ProcessName = "hl.exe" Then
		p.PriorityClass = ProcessPriorityClass.Idle
	  End If
	Next p
  Catch
  End Try
End If
End Sub

 

Thanks for any attention to this you can provide. And double thanks for the UniServer's existence!

It could be a welcome extra...

 

Alternatively, I use ProcessExplorer to change processes priority. Of course it could be a hassle for development since changing process priority every time your you restart a service is not really practical. In a production environment I don't see it as a big deal though.

<p class="bbc_center"><span style="font-size:12px;"><strong>Yoni</strong></span></p>

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.