<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Karl Kubelet</title>
    <description>The latest articles on DEV Community by Karl Kubelet (@kubelet).</description>
    <link>https://dev.to/kubelet</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2108658%2F903f0b12-8ffe-4645-90f9-b4af1ef0ce0d.jpg</url>
      <title>DEV Community: Karl Kubelet</title>
      <link>https://dev.to/kubelet</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kubelet"/>
    <language>en</language>
    <item>
      <title>TIL snippets/fastcgi-php.conf</title>
      <dc:creator>Karl Kubelet</dc:creator>
      <pubDate>Thu, 11 Sep 2025 11:20:45 +0000</pubDate>
      <link>https://dev.to/kubelet/til-snippetsfastcgi-phpconf-3blf</link>
      <guid>https://dev.to/kubelet/til-snippetsfastcgi-phpconf-3blf</guid>
      <description>&lt;p&gt;For many many years, my PHP location in Nginx looked like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;location ~ \.php$ {
    include snippets/fastcgi-php.conf;
    fastcgi_pass unix:/var/run/php/php-fpm.sock;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I never questioned it, it's just been copy-pasted a billion times over and over from thousands of online resources with PHP and WordPress tutorials.&lt;/p&gt;

&lt;p&gt;Today, while writing the &lt;a href="https://wpshell.com/lesson/nginx-config/" rel="noopener noreferrer"&gt;Nginx configuration lesson&lt;/a&gt;, I decided to question it, and tried to understand what every single line does, and why it's necessary.&lt;/p&gt;

&lt;p&gt;Turns out, it's mostly redundant. The &lt;code&gt;fastcgi-php.conf&lt;/code&gt; snippet was created for admins to avoid having to define a &lt;code&gt;SCRIPT_FILENAME&lt;/code&gt; (and &lt;code&gt;PATH_INFO&lt;/code&gt; in some older tutorials) manually, as well as include the default &lt;code&gt;fastcgi_params&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Not sure why so many tutorials decided to add this snippet, without removing the redundant bits. My new location block now looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;location ~ \.php$ {
    include snippets/fastcgi-php.conf;
    fastcgi_pass unix:/var/run/php/php-fpm.sock;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And this makes me happy.&lt;/p&gt;

&lt;p&gt;Sometimes it's worth questioning things we do a certain way, simply because we've been doing them this way for many years.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>wordpress</category>
      <category>nginx</category>
      <category>php</category>
    </item>
    <item>
      <title>Self-hosting WordPress</title>
      <dc:creator>Karl Kubelet</dc:creator>
      <pubDate>Sat, 06 Sep 2025 10:13:04 +0000</pubDate>
      <link>https://dev.to/kubelet/self-hosting-wordpress-26md</link>
      <guid>https://dev.to/kubelet/self-hosting-wordpress-26md</guid>
      <description>&lt;p&gt;I do consulting for some mid to large organizations using WordPress and WooCommerce, and last week I've successfully migrated yet another site from a top-tier reputable managed WordPress hosting provider, to a small dedicated server for half the monthly cost.&lt;/p&gt;

&lt;p&gt;Not a particularly lightweight site. We've got WooCommerce with some paid plugins from the Woo marketplace. We have some marketing slop too. The site was struggling with performance and often down during peak hours. The few messages in their managed hosting support history are all prompting them for an upgrade to a $400/mo plan.&lt;/p&gt;

&lt;p&gt;So we got a Ryzen 9 9900X for about $220/mo. Here are the stats from a week of production traffic to their WooCommerce site:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;15m load average: 3.50 of 24.0 or 15%&lt;/li&gt;
&lt;li&gt;database load: ~ 40% of the allocated 4 cores&lt;/li&gt;
&lt;li&gt;disk io, network, etc: negligible&lt;/li&gt;
&lt;li&gt;uncached avg. response time: 534ms&lt;/li&gt;
&lt;li&gt;cached avg. response time: 19ms&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We've yet to see some stats from a full list email blast, which they had on pause for the past six months, but should resume shortly after this migration is finalized.&lt;/p&gt;

&lt;p&gt;No crappy plugins were deactivated during this migration. Except the ones forced down from their previous provider of course. They're using WP Rocket for their caching needs, which they were not allowed to do before because their provider had their own "optimal" implementation which had about a 4% overall hit rate.&lt;/p&gt;

&lt;p&gt;Other than that the setup is pretty standard Nginx with PHP-FPM and MariaDB. This is not rocket science.&lt;/p&gt;

&lt;p&gt;I'm currently working on a &lt;a href="https://wpshell.com/?ref=devto" rel="noopener noreferrer"&gt;self-hosting WordPress course&lt;/a&gt; where I cover this and a lot more. I've already published 18 free lessons to get your started.&lt;/p&gt;

&lt;p&gt;End-to-end open source. Self-hosting is the future.&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>devops</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Why you SHOULD NOT host WordPress in Kubernetes</title>
      <dc:creator>Karl Kubelet</dc:creator>
      <pubDate>Sun, 22 Sep 2024 10:37:28 +0000</pubDate>
      <link>https://dev.to/kubelet/why-you-should-not-host-wordpress-in-kubernetes-2kk4</link>
      <guid>https://dev.to/kubelet/why-you-should-not-host-wordpress-in-kubernetes-2kk4</guid>
      <description>&lt;p&gt;I'm a big fan of Kubernetes. In fact, I'm working on a complete guide to &lt;a href="https://kubeadm.org" rel="noopener noreferrer"&gt;running WordPress in Kubernetes&lt;/a&gt;. A proper one, with horizontal scaling and everything. However, time and time again I come across individuals and organizations, wishing to run WordPress in a Kubernetes cluster without any good reasons to do it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Complexity Overhead
&lt;/h2&gt;

&lt;p&gt;Let's get one thing straight: &lt;strong&gt;Kubernetes is powerful&lt;/strong&gt;. It's fantastic for applications that need to scale dynamically, have complex infrastructure requirements, or benefit from microservices. But does WordPress really need all that?&lt;/p&gt;

&lt;p&gt;For most WordPress sites, Kubernetes adds a mountain of unnecessary complexity. What could be handled with a simple LAMP stack on a $5/month shared hosting plan suddenly requires managing:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Persistent storage&lt;/strong&gt;: WordPress needs reliable storage for media files and user uploads. Kubernetes doesn't natively deal with that, so you'll have to figure out how to manage volumes, backups, and recoveries. Good luck getting that right in one go!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Database scaling and backups&lt;/strong&gt;: Sure, you could run MySQL in a Kubernetes pod, but then you're also responsible for scaling, replication, and backing it up. Isn't that what managed database services are for?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Networking and load balancing&lt;/strong&gt;: Kubernetes offers a great abstraction layer for handling network traffic, but in most cases, WordPress needs something much simpler. Setting up ingress controllers, configuring SSL certificates, and balancing traffic across multiple instances is often overkill when you could just be using a managed load balancer—or, in the case of a small site, just relying on your basic shared hosting's built-in support.&lt;/p&gt;

&lt;p&gt;Every layer you add means more things to configure, more things that can go wrong, and ultimately more things you (or your team) need to maintain.&lt;/p&gt;

&lt;p&gt;And we haven't even talked about the &lt;strong&gt;learning curve&lt;/strong&gt;. Unless your team is already experienced with Kubernetes, expect to spend a lot of time learning how to operate clusters, troubleshoot pod failures, and work out issues like container restarts or misconfigured services. All of this time could be spent doing something more useful—like, I don't know, building a better WordPress site?&lt;/p&gt;

&lt;h2&gt;
  
  
  The Cost Factor
&lt;/h2&gt;

&lt;p&gt;Let's not forget the money side of things. Shared hosting plans are dirt cheap for what they offer: one-click WordPress installs, automatic updates, free SSL certificates, backups, and more. You can get a WordPress site up and running for $5–$10 a month without any headaches.&lt;/p&gt;

&lt;p&gt;Now, compare that to Kubernetes.&lt;/p&gt;

&lt;p&gt;First, you'll need cloud infrastructure to host your Kubernetes cluster. Depending on your cloud provider, you're looking at costs for compute, storage, and bandwidth. These won't be massive for a small WordPress site, but you're already far beyond what you'd pay for a basic hosting plan.&lt;/p&gt;

&lt;p&gt;Then you need to manage the cluster itself. Managed Kubernetes services (like GKE, EKS, or AKS) simplify the control plane, but they come with their own costs. And if you're running this on-premise? Get ready to spend a fortune on hardware, not to mention ongoing operational costs.&lt;/p&gt;

&lt;p&gt;Add the hidden costs of maintaining the cluster: hiring or training staff to manage Kubernetes, setting up monitoring and alerting systems, and troubleshooting issues as they arise. Suddenly, that "cool" Kubernetes project starts feeling like an unnecessary financial drain.&lt;/p&gt;

&lt;p&gt;At this point, you're probably spending more in a month than you would in a year on shared hosting—and for what? Slightly better uptime? Scalability you don't need?&lt;/p&gt;

&lt;h2&gt;
  
  
  When Does It Make Sense?
&lt;/h2&gt;

&lt;p&gt;Now, don't get me wrong—there are times when running WordPress on Kubernetes can make sense. Maybe you have a high-traffic website where downtime is unacceptable, and you need the horizontal scaling that Kubernetes offers. Or maybe your team already has deep expertise in Kubernetes, and you can run everything in-house without much extra effort.&lt;/p&gt;

&lt;p&gt;But for most websites, the added complexity and cost of Kubernetes just aren't worth it. If you're running a blog, a small business site, or even a mid-sized eCommerce store, you're probably better off with traditional hosting. It's cheaper, simpler, and significantly less of a headache.&lt;/p&gt;

&lt;h2&gt;
  
  
  Closing thoughts
&lt;/h2&gt;

&lt;p&gt;At the end of the day, just because Kubernetes can run WordPress doesn't mean it should. While I'm all for innovation and pushing the boundaries of what's possible, we need to be realistic about the cost and complexity involved. Running WordPress on Kubernetes is like driving a Formula 1 car to pick up groceries — it's a bit overkill, expensive, and will likely cause you more trouble than it's worth.&lt;/p&gt;

&lt;p&gt;So before you jump on the Kubernetes bandwagon, ask yourself: Do you really need it? Or are you just creating a solution that's way more complicated than the problem requires?&lt;/p&gt;

&lt;p&gt;Sometimes, simple really &lt;em&gt;is&lt;/em&gt; better.&lt;/p&gt;

&lt;p&gt;P.S. I'm Karl. Follow me if you're interested in WordPress, Kubernetes, Scaling, Performance, DevOps and those other geeky things.&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>kubernetes</category>
      <category>webdev</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
