As I mentioned in my last blog post I just recently built a new PC. It is a pretty powerful PC (9900k, 2080TI, 32GB RAM) but I noticed I had a weird issue when playing games.
When attempting to watch a Youtube video or a Twitch stream while gaming the video would stutter. Also when attempting to stream “The Division 2” Streamlabs OBS would only get ~15FPS (while the game was running at ~110FPS).
If I clicked out of the game so that it lost focus everything start running fine until the game had focus again.
After some digging I found out this was caused by Windows 10 “Game Mode”.
Disabling “Game Mode”
Press the Start button, then select Settings.
Choose Gaming > Game Mode.
Turn Game Mode On or Off.
What does “Game Mode” do?
Microsoft lists here that Game Mode does two things:
Prevents Windows Update from performing driver installations and sending restart notifications.
Helps achieve a more stable frame rate depending on the specific game and system.
I am unsure what it exactly means by the 2nd bullet point, but I am guessing it just causes the game to run at a higher processes priority then then everything else on your system.
When I switched this off I saw no change in performance for my game, and everything started running smooth outside of it.
What else could it be?
When searching around this issue a common thing that would come up is that if you have multiple displays running at different refresh rates this could cause an issue. This was not the case for me since both of my monitors are 144hz, but could be the case for you if your monitors have different refresh rates.
Last week I built a new PC for general desktop use and also for gaming. Since I am a huge monitoring nerd I wanted to get it setup in Prometheus so that I could monitor everything including temperatures (since I am doing a bit of overclocking for the first time).
Here is a quick breakdown of the tools I am using to make this work and a live look at the Grafana dashboard.
I am using a standard install of Prometheus on my little home server. If you wanted to you could easily run this on your actual PC using Docker but I wanted to allow external access without opening any public access to my PC.
Most of our metrics are coming from the wmi_exporter. I am just using the default collectors it enables and that has given me most of the information I have wanted.
The one area that wmi_exporter does lack is GPU information and tempatures. Luckily OhmGraphite can pull this information for us and export it for Prometheus to read. Sadly it does not follow all the standards for metric/label naming for Prometheus so building dashboards can get a little weird.
Now to finally tie it all together and display it nicely is Grafana. I exported a copy of my dashboard here.
Here is a live example of my dashboard up and running with actual metrics. Also some screenshots:
This was a brief overview of my monitoring setup. If you have any specific questions please feel free to reach out.
If you use Yoast SEO to manage redirects and you change your permalink structure you may need to update a large amount of your redirects.
Here is a small simple script to help with that. This was made for when you switch from https://www.sethryder.com/2018/10/31/sample-post/to https://www.sethryder.com/sample-post/. If you are switching to something else it should be easy to modify, you will just need to update the regex in the preg_replace.
The two rows you will want to run through this script in your database are the wpseo-premium-redirects-export-plainand the wpseo-premium-redirects-basein wp_options. I assume they may vary if you are not using the premium version of the plugin.
This script will take the serialized options in the database (that you copy into the expected text files) and go through them and remove/update the redirect links. Once finished it writes them to the new files and you can replace the rows in your database.
Recently I had to migrate a blog from its own subdomain to the primary domain in a directory (Example: blog.domain.com to www.domain.com/blog).
Migrating a blog to a different domain is easy enough and I have done it countless times. The twist this time is that they also wanted to switch the permalink structure from https://www.domain.com/2018/10/30/sample-post/to https://www.domain.com/sample-post/.
After some quick research it appears there are few plugins for WordPress that will help you with this. But even some of them require manually setting up redirects for each blog post. Also I like to avoid unnecessary plugins as this adds more to maintain, especially when you are managing a large amount of sites.
So the easiest way to do this is just with a simple rewrite/redirect. Here is what I am using in nginx:
Make sure you update to the new permalink structure right before placing the rewrite rule as this will cause 404 errors if you haven’t switched to the new structure.
This should be easy enough to do with Apache and moving from other date based permalink structure.
In the past year I moved our teams entire infrastructure monitoring from Nagios/collectd to Prometheus. The amount of visibility into our infrastructure it has provided that we didn’t have before has been invaluable.
We host a bunch of small WordPress and other custom built websites (along with a couple very large sites) that we use the Blackbox exporter to monitor the response code and SSL Certificate status. I wanted to be able to keep all the sites we monitored in two files without having to modify the prometheus.yml every time I needed to add or remove a site which could require a reload of Prometheus.
I ended up using the file based service discovery for this. I had to dig quite a bit to find an example (which I think I found in a Github issue). Someday I want to expand this to use proper service discovery (like we do for all the other exporters) but I wanted something simple to start.
Below is examples how I have this setup in the Prometheus and Blackbox exporter configs.
1) Add the blackbox exporter job to the prometheus.yml file:
2) Then we need to configure the Blackbox Exporter on how to handle our two config files (one for http one for https):
3) Finally our last two configs. These are the actually lists of sites that the blackbox exporter will be monitoring.
That should be it. Any changes you make to either of the http_2xx.yml or https_2xx.yml config will automatically be picked up by Prometheus based on your scrape_interval setting.
Feel free to give me a shout if you have any questions or issues.