Single process is slowing down internet connection – solved with quality of service (QoS)

Scenario

You experience the following situations when using Windows:

  • Using an internet connection where bandwidth capacity is limited
    • Wide Area Network (WAN) link
    • Home or residential grade ADSL/cable/broadband; or
    • You live in Australia.
  • One or more computers within the network is saturating the internet link (perhaps you’re trying to watch YouTube videos too and they’re buffering)
  • The network usage is essential or routine, and therefore cannot or should not be cancelled
  • It has a crippling effect on the internet connection for all users on the network (Skype calls are terrible quality, videos buffer, etc.)
  • Programs responsible may include OneDrive sync traffic, Dropbox, OneNote sync to Office365 or Microsoft cloud storage, FTP traffic, “the kids computer traffic”, torrent programs or generally anything involving large file transfer.

Proposed Technology

Take advantage of Quality of Service. It’s so magical! Definition from Wikipedia:

Quality of service (QoS) is the overall performance of a telephony or computer network, particularly the performance seen by the users of the network.

To quantitatively measure quality of service, several related aspects of the network service are often considered, such as error rates, bit rate, throughput, transmission delay, availability, jitter, etc.

Quality of service is particularly important for the transport of traffic with special requirements. In particular, much technology has been developed to allow computer networks to become as useful as telephone networks for audio conversations, as well as supporting new applications with even stricter service demands.

Source: https://en.wikipedia.org/wiki/Quality_of_service
Last Accessed: 7 Sep 2015

However, CISCO’s documentation includes the point most relevant to the aforementioned scenario:

The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. Also important is making sure that providing priority for one or more flows does not make other flows fail.

Source: http://docwiki.cisco.com/wiki/Quality_of_Service_Networking
Last Accessed: 7 Sep 2015

This is precisely our situation: we’re seeing flows fail through no or poor Quality of Service (QoS) configuration.

QoS is configurable at a network (routers and firewalls) or computer system tier. For example if FTP traffic is slowing down your entire network, QoS configuration could be applied to FTP ports at the router level, enforcing the policy upon all network users.

Though, this post will focus on configuring QoS at the Windows operating system level. The advantage being, QoS policies are granular and can be set to target all programs, specific .exe files, paths with wildcards, or any URL/hostname – without requiring access or having technical know-how with network equipment like routers or firewalls.

Obviously in corporate environments, the QoS policy would be deployed through group policy using object level targeting. This would ensure only systems requiring the configuration receive it. While this blog won’t detail group policy implementation, it does explain 90% of the work required for corporate group policy rollout, making adaptation easy.

Example

In my scenario, I need to prevent OneDrive from flooding my network. I’ve documented the process below for replication.

You’ll need to open the local group policy editor on the local system. Another method is to Start > Run, or Windows Key + R and open gpedit.msc. I find it easy to just type gpedit.msc in the start search box though.

Open the local group policy editor

Open the local group policy editor

Group policy editor MMC

Group policy editor MMC

Expand the Computer Configuration node and Windows Settings. You’ll see Policy-based QoS. Right mouse click and click Create new policy.

Create a new QoS policy

Create a new QoS policy

Give the policy a name that identifies it among others. I’m targeting OneDrive so I’ve named mine “OneDrive”.

Whether Differentiated Services Code Point (DSCP) values or a speed rate are used, depends on the situation.

I prefer to utilise bandwidth if it is available for use, and hence prefer the DSCP values. DSCP values prioritise traffic or differentiate levels of service. Alternatively, speed limits simply restrict the maximum speed of upload/download – even if there’s ample bandwidth available.

Consider I have 20GB of files to sync with OneDrive. Reducing the speed of upload won’t best utilise the bandwidth available and will only serve to slow down the speed those files sync. Instead I want the QoS policy to reduce the OneDrive sync traffic priority to below that of other normal traffic (web browsing, VoIP calls, video, etc.).

Common DSCP values:

  • 0 = Not applicable, off or none (QoS is disabled)
  • 8 = Scavenger
  • 10 = Bulk data
  • 16 = Network management
  • 18 = Transactional Data
  • 24 = Call Signaling
  • 26 = Mission-Critical Data
  • 32 = Streaming Video
  • 34 = Video Conferencing
  • 46 = Voice
  • 48 = Network Routing

I recommend a DSCP Value of 1 to 10 for low priority traffic and have found it the most effective.

For example, if backing up data over the network I noticed congestion affecting normal traffic, I’d select a DSCP Value between 1 and 10. If I was prioritising video, I’d select a more appropriate, higher priority value.

In my case of OneDrive sync, I decided to go with a DSCP Value of 10.

Define the QoS policy

Define the QoS policy

Enter the name of the executable file. I looked up the process to confirm I got the name correct. A full path with wildcards can be used, but honestly it’s not important in this case.

Define the QoS policy target

Define the QoS policy target

Here’s an example of looking up the process name. Just right mouse click on the process, click Properties.

OneDrive process in Task Manager

OneDrive process in Task Manager

One could apply the policy to only traffic coming and going to certain networks. Though I want my QoS OneDrive sync policy to apply to any/all networks.

Define the QoS policy source/destination

Define the QoS policy source/destination

While the protocol is adjustable, I personally am only concerned with TCP traffic.

I don’t bother with port numbers as I need the policy to apply to all traffic created by the OneDrive.exe process, regardless of what ports are used by that process.

Define the QoS policy protocol

Define the QoS policy protocol and/or port

Finished! The policy starts effect immediately, no restart or process recycle required. Below is a few other examples I prepared.

List of QoS policies

List of QoS policies

What’s your scenario? Let me know why you’re adjusting your QoS policies in Windows. 🙂

 

VN:F [1.9.22_1171]
Rating: 2.0/5 (9 votes cast)
VN:F [1.9.22_1171]
Rating: +4 (from 8 votes)
Leave a comment

Hung, Stalled, Blank Page During WordPress Core, Plugins, Themes, etc. Upgrade

Problem

When upgrading WordPress core, theme, language or plugin – the update downloads successfully but leaves a blank upgrade screen, the page stops loading, you may be stuck in maintenance mode (requiring manual removal of .maintenance) and overall the upgrade never completes.

Observations

  1. Using WordPress version 4.x
  2. Accessing the WordPress site via HTTP (not HTTPS)
  3. When upgrading, I saw WordPress downloaded the zip file via HTTPS
  4. Using WordPress.com Jetpack (not sure if related or not)
  5. Google returns very few results describing the problem well.

Workaround

I’ve tested this against four WordPress sites now and it appears to have successfully worked around the problem.

I installed a self-signed SSL certificate against the WordPress site using Server Name Indicator (SNI). Remember no dedicated IP is required when using SNI but it need a compatible server. For convenience I’ve used SSL certificates from tinycert.org.

Now when I access the site over HTTPS:

  1. Login again – note SSO with untrusted certificate will not work, you must use local site login credentials
  2. Perform the upgrade – it completes successfully and does not result in a blank or stalled upgraded screen.

Do you see another pattern? Isolated it to a version, Jetpack or another update? Please let me know!

Other Possible Causes

The above resolved my issue, but similar issues include:

VN:F [1.9.22_1171]
Rating: 1.7/5 (7 votes cast)
VN:F [1.9.22_1171]
Rating: -1 (from 9 votes)
2 Comments

Waiting for Azure…

Most sysadmins by now have experienced “the cloud” and all the cost cutting fun that comes with it. My colleagues and I primarily work with Microsoft Azure.

While the Azure portal has improved, we’ve found numerous circumstances where improvement is still needed.

One example, when dealing with a handful of subscriptions attached to the same login account, packed with large number of items – everything slows down on first load. I’m not sure if it’s related, but usually the category you need to get access to immediately is the last to load.

The return times on actions like creating a new storage account can vary from 10 seconds to 3 minutes – not just via the portal but when using Powershell and the Management API.

These and some other painfully slow circumstances,  have resulted in a common phrase emerging around the office: “I’m waiting for Azure”. While waiting for Azure, a colleague and good friend of mine had the time to create the following diagram for laughs. Enjoy.

Time spent waiting for Azure

Time spent waiting for Azure

VN:F [1.9.22_1171]
Rating: 2.3/5 (10 votes cast)
VN:F [1.9.22_1171]
Rating: +1 (from 15 votes)
1 Comment