<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Wilfried Roset, Author at OVHcloud Blog</title>
	<atom:link href="https://blog.ovhcloud.com/author/wilfried-roset/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.ovhcloud.com/author/wilfried-roset/</link>
	<description>Innovation for Freedom</description>
	<lastBuildDate>Wed, 24 Sep 2025 11:48:45 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://blog.ovhcloud.com/wp-content/uploads/2019/07/cropped-cropped-nouveau-logo-ovh-rebranding-32x32.gif</url>
	<title>Wilfried Roset, Author at OVHcloud Blog</title>
	<link>https://blog.ovhcloud.com/author/wilfried-roset/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>OVHcloud and Epitech Team Up: Building the Future Together!</title>
		<link>https://blog.ovhcloud.com/ovhcloud-and-epitech-team-up-building-the-future-together/</link>
		
		<dc:creator><![CDATA[Wilfried Roset]]></dc:creator>
		<pubDate>Wed, 24 Sep 2025 11:48:44 +0000</pubDate>
				<category><![CDATA[Ecosystem]]></category>
		<category><![CDATA[OVHcloud Partner Program]]></category>
		<category><![CDATA[Sovereignty]]></category>
		<category><![CDATA[Partnership]]></category>
		<category><![CDATA[sovereignty]]></category>
		<category><![CDATA[students]]></category>
		<guid isPermaLink="false">https://blog.ovhcloud.com/?p=29628</guid>

					<description><![CDATA[At OVHcloud, we know great ideas happen when in-school learning meets real-world experience. The future isn&#8217;t something that happens to us, it&#8217;s something we build — day by day. To do that, we need to support the students who will be tomorrow&#8217;s leaders. That’s why we’re so excited to announce our new partnership with Epitech [&#8230;]<img src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fovhcloud-and-epitech-team-up-building-the-future-together%2F&amp;action_name=OVHcloud%20and%20Epitech%20Team%20Up%3A%20Building%20the%20Future%20Together%21&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></description>
										<content:encoded><![CDATA[
<p>At OVHcloud, we know great ideas happen when in-school learning meets real-world experience. The future isn&#8217;t something that happens to us, it&#8217;s something we build — day by day. To do that, we need to support the students who will be tomorrow&#8217;s leaders. </p>



<p>That’s why we’re so excited to announce our new partnership with <strong><a href="https://www.epitech.eu/" data-type="link" data-id="https://www.epitech.eu/" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">Epitech</a></strong> 🥳, a school renowned for helping talented students learn.</p>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="1024" height="937" src="https://blog.ovhcloud.com/wp-content/uploads/2025/09/epitech-x-ovh.png" alt="generated with AI" class="wp-image-29630" srcset="https://blog.ovhcloud.com/wp-content/uploads/2025/09/epitech-x-ovh.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2025/09/epitech-x-ovh-300x275.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2025/09/epitech-x-ovh-768x703.png 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading">From Classroom to Career</h2>



<p>This new partnership is our promise to help students succeed, giving them the tools and experience they need to build great things. Here’s how we’ll be helping the Epitech community:</p>



<ul class="wp-block-list">
<li><strong>Fun Hackathons:</strong> We&#8217;ll host hackathons where students can team up to solve real problems and be creative, turning good ideas into actual projects. 💡</li>
</ul>



<ul class="wp-block-list">
<li><strong>Great Internships:</strong> Epitech students can come work with our teams. Our <a href="https://careers.ovhcloud.com/en/ovhcloud-and-you/your-ovhcloud-experience/student/" data-type="link" data-id="https://careers.ovhcloud.com/en/ovhcloud-and-you/your-ovhcloud-experience/student/" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">internships</a> offer a real chance to use what they&#8217;ve learned in class and to get a solid start on their careers.</li>
</ul>



<ul class="wp-block-list">
<li><strong>Hands-on Training:</strong> Our experts will run special workshops for students. They&#8217;ll learn the latest tech skills directly from the people who use them firsthand every day.</li>
</ul>



<ul class="wp-block-list">
<li><strong>Help for Students:</strong> New ideas often start with research. We&#8217;ll give Epitech&#8217;s students special access to <a href="https://www.ovhcloud.com/en/public-cloud/" data-type="link" data-id="https://www.ovhcloud.com/en/public-cloud/" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">public cloud services</a> on beneficial terms. We want to help them turn their ideas into reality, faster! 🔬</li>
</ul>



<h2 class="wp-block-heading">This Is Just the Beginning</h2>



<p>Our partnership with Epitech is a huge first step for us, but we&#8217;re just getting started.<br>OVHcloud aims to team up with more schools in the future, as we believe it&#8217;s imperative for companies and schools to work together! By supporting students everywhere, we help them become the strong leaders of tomorrow.</p>



<h2 class="wp-block-heading">Schools Are Our Future</h2>



<p>We&#8217;re deeply convinced of this simple truth: <strong>the future is in the hands of today&#8217;s students.</strong></p>



<p>In an ever-evolving landscape, building a sustainable and innovative future depends on our ability to develop and master our own technologies.&nbsp; And in today’s geopolitical context, where questions of digital independence and data control are more critical than ever, giving young talents the means to innovate locally is not just an opportunity — it’s a necessity.</p>



<p><strong>After all, technical sovereignty doesn&#8217;t start in boardrooms, it starts in schools</strong>. By providing students with the skills, tools, and mindsets to design and control their own digital solutions, we are actively contributing to a stronger, more resilient ecosystem. By investing in education, we&#8217;re investing in our future &#8211; ensuring that the next generation of engineers, developers, and visionaries have the opportunity to build a better, more technologically advanced world. In this world of tomorrow, Europe and its partners remain free, innovative, and sovereign.</p>



<p>To everyone at Epitech, we can’t wait to start working with you. Let’s build the future together!</p>



<p></p>
<img decoding="async" src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fovhcloud-and-epitech-team-up-building-the-future-together%2F&amp;action_name=OVHcloud%20and%20Epitech%20Team%20Up%3A%20Building%20the%20Future%20Together%21&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Picking our Prometheus&#8217; remote storage</title>
		<link>https://blog.ovhcloud.com/picking-our-prometheus-remote-storage/</link>
		
		<dc:creator><![CDATA[Wilfried Roset]]></dc:creator>
		<pubDate>Mon, 17 Apr 2023 14:43:34 +0000</pubDate>
				<category><![CDATA[OVHcloud Engineering]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Observability]]></category>
		<category><![CDATA[prometheus]]></category>
		<guid isPermaLink="false">https://blog.ovhcloud.com/?p=24588</guid>

					<description><![CDATA[If you are running an IT system you are most likely using an Observability stack along it. Nowadays, the question&#8217;s no more whether or not you need Observability but more like how will you compose your stack. At OVHcloud, we have been running a scalable timeseries backend for years now. During the last year, we [&#8230;]<img src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fpicking-our-prometheus-remote-storage%2F&amp;action_name=Picking%20our%20Prometheus%26%238217%3B%20remote%20storage&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></description>
										<content:encoded><![CDATA[
<p>If you are running an IT system you are most likely using an Observability stack along it. Nowadays, the question&#8217;s no more whether or not you need Observability but more like how will you compose your stack. At OVHcloud, we have been running a scalable timeseries backend for years now. </p>



<p>During the last year, we have the opportunity to reassess our technical choices. Prometheus is the <em>de facto</em> standard but this choice is the beginning of the process. Thanks to open source communities, there is at lot of possible choices. </p>



<p>The <a href="https://blog.ovhcloud.com/tag/prometheus/" data-wpel-link="internal">previous posts</a> were about the process we have followed select our new backend, this one concludes the series and share what we have chosen and why. In case you missed them, this series covers an <a href="https://blog.ovhcloud.com/welcome-to-prometheus-world-of-remote-storage/" target="_blank" rel="noreferrer noopener" data-wpel-link="internal">introduction to Prometheus remote storage</a>, how to bench such solution from both <a href="https://blog.ovhcloud.com/prometheus-remote-storage-playground/" target="_blank" rel="noreferrer noopener" data-wpel-link="internal">write</a> and <a href="https://blog.ovhcloud.com/benchmarking-prometheus-promql-performance/" target="_blank" rel="noreferrer noopener" data-wpel-link="internal">read</a> perspective the hard way or <a href="https://blog.ovhcloud.com/benchmarking-prometheus-like-a-pro-with-k6/" target="_blank" rel="noreferrer noopener" data-wpel-link="internal">like a pro</a>.</p>



<figure class="wp-block-image aligncenter size-large is-resized"><img decoding="async" src="https://blog.ovhcloud.com/wp-content/uploads/2023/04/IMG_1488-1024x538.jpg" alt="Picking our Prometheus' remote storage" class="wp-image-25069" width="512" height="269" srcset="https://blog.ovhcloud.com/wp-content/uploads/2023/04/IMG_1488-1024x538.jpg 1024w, https://blog.ovhcloud.com/wp-content/uploads/2023/04/IMG_1488-300x158.jpg 300w, https://blog.ovhcloud.com/wp-content/uploads/2023/04/IMG_1488-768x404.jpg 768w, https://blog.ovhcloud.com/wp-content/uploads/2023/04/IMG_1488.jpg 1199w" sizes="(max-width: 512px) 100vw, 512px" /></figure>



<h3 class="wp-block-heading">And the winner is&#8230; Grafana Mimir!</h3>



<p>After all the experimentation we have made we have chosen Grafana Mimir. The first reason why this solution&#8217;s a good fit for use is Its read/write performance&#8217;s excellent as well as its scalability. My team, core-observability, main mission&#8217;s to provide a resilient and feature full observability infrastructure. All teams relying on us, each of them has it own particularity. Multitenancy is a must have for us, with it we must be able to prevent side effect or &#8220;noisy neighboor&#8221;. This is why rate limiting was on our bucket list. Mimir provides a lots of setting both at the cluster level and the tenant level to make sure one tenant does not impact others or simply impact the quality of services.</p>



<figure class="wp-block-image alignright size-full is-resized"><img loading="lazy" decoding="async" src="https://blog.ovhcloud.com/wp-content/uploads/2023/04/IMG_1489.png" alt="Grafana Mimir" class="wp-image-25072" width="265" height="96" srcset="https://blog.ovhcloud.com/wp-content/uploads/2023/04/IMG_1489.png 529w, https://blog.ovhcloud.com/wp-content/uploads/2023/04/IMG_1489-300x108.png 300w" sizes="auto, (max-width: 265px) 100vw, 265px" /></figure>



<p>Like many cloud native technology Mimir relies on an <a href="https://www.ovhcloud.com/en/public-cloud/object-storage/" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">object storage</a> where the timeseries are stored. Doing so allow to decouple the compute from the storage and therefore avoids to add more computing power or bigger disks to offer the retentions your users need. Data are compacted to have the small storage footprint possible and therefore achieve cost efficiency.</p>



<p>As we said in our, Prometheus is today <em>de facto</em> standard when it comes to timeseries. We wanted to offer our users the full experience, 100% compliant with <a href="https://promlabs.com/promql-compliance-tests/" rel="nofollow external noopener noreferrer" data-wpel-link="external" target="_blank">promql</a>, recording and alerting rules. Mimir is fully featured on this side, it&#8217;s even part of a bigger picture with more integration which is like icing on the cake. Let&#8217;s start with Grafana, which is of course fully compatible with Mimir, you can also manage you recording or alerting rules directly from the UI. Now comes <a href="https://grafana.com/oss/loki/" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">Loki</a> which is like prometheus but for logs, it allow you to query your logs just like your metrics. And finally <a href="https://grafana.com/oss/tempo/" rel="nofollow external noopener noreferrer" data-wpel-link="external" target="_blank">Tempo</a> which cover the last observability pillar: distributed tracing.</p>



<p>On the operational side, there is no doubt that Mimir has been built with production stability and resiliency in mind. The default settings are production ready, the documentation is crystal clear but you also have the material to facilitate the day to day care of Mimir in production. As SREs running Mimir you can use their knowledge base. You have at your disposal ready to use <a href="https://github.com/grafana/mimir/tree/main/operations/mimir-mixin-compiled/dashboards" rel="nofollow external noopener noreferrer" data-wpel-link="external" target="_blank">dashboards</a>, <a href="https://github.com/grafana/mimir/blob/main/operations/mimir-mixin-compiled/rules.yaml" rel="nofollow external noopener noreferrer" data-wpel-link="external" target="_blank">recording</a> &amp; <a href="https://github.com/grafana/mimir/blob/main/operations/mimir-mixin-compiled/alerts.yaml" rel="nofollow external noopener noreferrer" data-wpel-link="external" target="_blank">alerting</a> rules and <a href="https://grafana.com/docs/mimir/latest/operators-guide/mimir-runbooks/" rel="nofollow external noopener noreferrer" data-wpel-link="external" target="_blank">runbook</a>. Of course deployment might be different one from another. This is a very good opportunity to contribute back to the vivid open source community around Grafana Labs. No matter the size of the contribution it is always welcomed and reviewed in a timely manner. Whether you need to adjust the <a href="https://github.com/grafana/mimir/pull/2657" rel="nofollow external noopener noreferrer" data-wpel-link="external" target="_blank">dashboards</a>, add a <a href="https://github.com/grafana/mimir/pull/2864" rel="nofollow external noopener noreferrer" data-wpel-link="external" target="_blank">feature</a>&nbsp;or <a href="https://github.com/grafana/mimir/pull/1803" rel="nofollow external noopener noreferrer" data-wpel-link="external" target="_blank">build deb/rpm packages</a> you can always <a href="https://github.com/grafana/mimir/tree/main/docs/internal/contributing" rel="nofollow external noopener noreferrer" data-wpel-link="external" target="_blank">contribute</a>.</p>



<p>The definitive reason why we have chosen Mimir is the core values of its maintainers. Kudos to them. They are welcoming, easy going and more importantly they take <a href="https://grafana.com/blog/2022/03/30/announcing-grafana-mimir/" rel="nofollow external noopener noreferrer" data-wpel-link="external" target="_blank">opensource seriously</a> just like us at OVHcloud. If you want to have a glimps of that come by their slack to see how fast they are answering.</p>



<p>My team can&#8217;t wait to see all the beautiful things our users will do with this backend. One thing&#8217;s sure, we&#8217;ll contribute back and make sure Mimir thrives. Let&#8217;s reserve this part for a new blog posts.</p>
<img loading="lazy" decoding="async" src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fpicking-our-prometheus-remote-storage%2F&amp;action_name=Picking%20our%20Prometheus%26%238217%3B%20remote%20storage&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Benchmarking Prometheus like a pro with k6</title>
		<link>https://blog.ovhcloud.com/benchmarking-prometheus-like-a-pro-with-k6/</link>
		
		<dc:creator><![CDATA[Wilfried Roset]]></dc:creator>
		<pubDate>Tue, 04 Apr 2023 12:19:05 +0000</pubDate>
				<category><![CDATA[OVHcloud Engineering]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Observability]]></category>
		<category><![CDATA[prometheus]]></category>
		<guid isPermaLink="false">https://blog.ovhcloud.com/?p=24585</guid>

					<description><![CDATA[In our previous posts about choosing a Prometheus remote storage we have seen how to&#160;set up a benchmarking infrastructure and how to benchmark promql performance. We have been able to obtain results but the whole benchmark is flawned in many ways: This blog post discuss how we should have benchmark our remote storage. How to [&#8230;]<img src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fbenchmarking-prometheus-like-a-pro-with-k6%2F&amp;action_name=Benchmarking%20Prometheus%20like%20a%20pro%20with%20k6&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></description>
										<content:encoded><![CDATA[
<p>In our previous posts about choosing a Prometheus remote storage we have seen how to&nbsp;<a href="https://blog.ovhcloud.com/prometheus-remote-storage-playground" target="_blank" rel="noreferrer noopener" data-wpel-link="internal">set up a benchmarking infrastructure</a> and <a href="https://blog.ovhcloud.com/benchmarking-prometheus-promql-performance" data-wpel-link="internal">how to benchmark promql performance</a>. We have been able to obtain results but the whole benchmark is flawned in many ways:</p>



<ul class="wp-block-list">
<li>it&#8217;s expensive as you need to spawn more than necessary to assess a particular point of your remote storage.</li>



<li>it&#8217;s hard to reproduce 100% the same setup, even with the same configuration and software version you will have a similar result but not exactly the same.</li>



<li>you&#8217;re not always benchmarking what you think you are. We have spent couple of time troubleshoot performance issue which where in <a href="https://github.com/prometheus/prometheus/issues/9807" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external">prometheus</a> or haproxy configuration.</li>



<li>it focus mainly on the write path without stress from the read path which is not realistic.</li>
</ul>



<figure class="wp-block-image aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://blog.ovhcloud.com/wp-content/uploads/2023/03/IMG_1433-1024x538.jpg" alt="Benchmarking Prometheus like a pro with k6" class="wp-image-24943" width="512" height="269" srcset="https://blog.ovhcloud.com/wp-content/uploads/2023/03/IMG_1433-1024x538.jpg 1024w, https://blog.ovhcloud.com/wp-content/uploads/2023/03/IMG_1433-300x158.jpg 300w, https://blog.ovhcloud.com/wp-content/uploads/2023/03/IMG_1433-768x404.jpg 768w, https://blog.ovhcloud.com/wp-content/uploads/2023/03/IMG_1433.jpg 1199w" sizes="auto, (max-width: 512px) 100vw, 512px" /></figure>



<p>This blog post discuss how we should have benchmark our remote storage.</p>



<h3 class="wp-block-heading">How to do a good benchmark? K6 to the rescue</h3>



<p>A good benchmark need to be accurate and reproducible. More over for our usecase we want to have a tool who takes into account both Prometheus&#8217;s read and write path. Finally, we need to be able to remove all unnecessary pieces. This way we are able to focus on the remote storage only.</p>



<p>Such software could be a project on its own but fortunately for us there is one opensource solution for that: <a href="https://k6.io/" rel="nofollow external noopener noreferrer" data-wpel-link="external" target="_blank">K6</a></p>



<p>K6 is a general purpose&nbsp; modern load testing which can be extended with module to support Prometheus remote storage. Sounds interesting don&#8217;t you think?</p>



<p>In our previous blog post we have explained how we have built our benchmarking infrastructure which was rather complex&nbsp; to be accurate.</p>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://github.com/wilfriedroset/remote-storage-wars/blob/master/assets/generic-infrastructure.png?raw=true" alt="generic-infrastructure.png"/></figure>



<p>With k6 as benchmarking tool the infrastructure can be greatly simplified:</p>



<figure class="wp-block-image aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://blog.ovhcloud.com/wp-content/uploads/2023/03/k6-1024x436.png" alt="With k6 as benchmarking tool the infrastructure can be greatly simplified" class="wp-image-24941" width="512" height="218" srcset="https://blog.ovhcloud.com/wp-content/uploads/2023/03/k6-1024x436.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2023/03/k6-300x128.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2023/03/k6-768x327.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2023/03/k6.png 1127w" sizes="auto, (max-width: 512px) 100vw, 512px" /></figure>



<p>K6 is quite flexible and configurable. Its input is a load testing script, you can either write your own script or reuse an <a href="https://github.com/grafana/mimir/tree/main/operations/k6" rel="nofollow external noopener noreferrer" data-wpel-link="external" target="_blank">opensourced one</a>. As the whole logic is in the load testing script it become easily reproducible which is exactly what we need.</p>



<p>To launch a benchmark you need two piece of infrastructure:</p>



<ul class="wp-block-list">
<li>Somewhere where you can run k6 which could be a <a href="https://www.ovhcloud.com/en-ie/public-cloud/prices/" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">c2-120 instance on our public cloud</a></li>



<li>A remote storage to benchmark. for a quick start users are one helm apply away to start on <a href="https://www.ovhcloud.com/en-ie/public-cloud/kubernetes/" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">k8s</a></li>
</ul>



<p>For our use case we have chosen to reuse the load testing from Grafana which does exactly what we are looking for. All useful information to tune and assess your remote storage are outputed by k6.</p>



<pre class="wp-block-code"><code class="">     ✓ write worked

     █ instant query high cardinality

       ✓ expected request status to equal 200
       ✓ has valid json body
       ✓ expected status field to equal 'success'
       ✓ expected data.resultType field to equal 'vector'

     █ range query

       ✓ expected request status to equal 200
       ✓ has valid json body
       ✓ expected status field is 'success' to equal 'success'
       ✓ expected resultType is 'matrix' to equal 'matrix'

     █ instant query low cardinality

       ✓ expected request status to equal 200
       ✓ has valid json body
       ✓ expected status field to equal 'success'
       ✓ expected data.resultType field to equal 'vector'

     checks............................................................................: 100.00% ✓ 1454     ✗ 0
     ✓ { type:read }...................................................................: 0.00%   ✓ 0        ✗ 0
     ✓ { type:write }..................................................................: 100.00% ✓ 6        ✗ 0
     data_received.....................................................................: 1.0 MB  8.4 kB/s
     data_sent.........................................................................: 277 kB  2.3 kB/s
     group_duration....................................................................: avg=64.61ms min=39.94ms med=60.43ms max=230.05ms p(90)=80.39ms p(95)=107.93ms
     http_req_blocked..................................................................: avg=4.65ms  min=2µs     med=6µs     max=96.84ms  p(90)=11µs    p(95)=58.42ms
     http_req_connecting...............................................................: avg=1.31ms  min=0s      med=0s      max=21.87ms  p(90)=0s      p(95)=16.99ms
     http_req_duration.................................................................: avg=53.7ms  min=34.23ms med=52.71ms max=164.1ms  p(90)=67.02ms p(95)=71.82ms
       { expected_response:true }......................................................: avg=53.7ms  min=34.23ms med=52.71ms max=164.1ms  p(90)=67.02ms p(95)=71.82ms
     ✓ { type:read }...................................................................: avg=53.8ms  min=34.23ms med=52.76ms max=164.1ms  p(90)=66.85ms p(95)=71.62ms
     ✓ { url:https://admin:security-matters@remote-storage.poc.ovh.net/api/v1/push }...: avg=0s      min=0s      med=0s      max=0s       p(90)=0s      p(95)=0s
     http_req_failed...................................................................: 0.00%   ✓ 0        ✗ 368
     http_req_receiving................................................................: avg=92.34µs min=32µs    med=89µs    max=301µs    p(90)=125.3µs p(95)=150µs
     http_req_sending..................................................................: avg=49.05µs min=12µs    med=40µs    max=566µs    p(90)=68µs    p(95)=94.59µs
     http_req_tls_handshaking..........................................................: avg=3.11ms  min=0s      med=0s      max=54.28ms  p(90)=0s      p(95)=39.39ms
     http_req_waiting..................................................................: avg=53.56ms min=33.94ms med=52.56ms max=163.93ms p(90)=66.88ms p(95)=71.66ms
     http_reqs.........................................................................: 368     3.064697/s
     iteration_duration................................................................: avg=64.88ms min=40.34ms med=60.78ms max=230.27ms p(90)=80.87ms p(95)=108.47ms
     iterations........................................................................: 368     3.064697/s
     vus...............................................................................: 26      min=26     max=26
     vus_max...........................................................................: 26      min=26     max=26
</code></pre>



<p>What a time saver? With k6 we have been able to efficiently assess all remote storage solutions. This is a <strong>significative</strong> improvement if we compare it to our previous benchmarking plan.</p>



<p>The next and final post will be about which remote storage we have chosen to be our internal solution.</p>



<p>Stay tuned.</p>
<img loading="lazy" decoding="async" src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fbenchmarking-prometheus-like-a-pro-with-k6%2F&amp;action_name=Benchmarking%20Prometheus%20like%20a%20pro%20with%20k6&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Prometheus&#8217; remote storage playground</title>
		<link>https://blog.ovhcloud.com/prometheus-remote-storage-playground/</link>
		
		<dc:creator><![CDATA[Wilfried Roset]]></dc:creator>
		<pubDate>Sun, 05 Mar 2023 23:49:35 +0000</pubDate>
				<category><![CDATA[OVHcloud Engineering]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Observability]]></category>
		<category><![CDATA[prometheus]]></category>
		<guid isPermaLink="false">https://blog.ovhcloud.com/?p=24583</guid>

					<description><![CDATA[Introduction In the previous post we have discuss how important remote storage are for Prometheus. We have also covered several attention points. In the following post we are covering remote write storage and how to bench them. Context After you have identify one (or more) remote storage who might suit your must bench it. However [&#8230;]<img src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fprometheus-remote-storage-playground%2F&amp;action_name=Prometheus%26%238217%3B%20remote%20storage%20playground&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading" id="Remotestorageplayground-Introduction">Introduction</h3>



<p>In the <a href="https://blog.ovhcloud.com/welcome-to-prometheus-world-of-remote-storage/" target="_blank" rel="noreferrer noopener" data-wpel-link="internal">previous post</a> we have discuss how important remote storage are for Prometheus. We have also covered several attention points. In the following post we are covering remote <strong>write</strong> storage and how to bench them.</p>



<figure class="wp-block-image aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://blog.ovhcloud.com/wp-content/uploads/2023/03/IMG_1324-1024x538.jpg" alt="Prometheus' remote storage playground" class="wp-image-24835" width="512" height="269" srcset="https://blog.ovhcloud.com/wp-content/uploads/2023/03/IMG_1324-1024x538.jpg 1024w, https://blog.ovhcloud.com/wp-content/uploads/2023/03/IMG_1324-300x158.jpg 300w, https://blog.ovhcloud.com/wp-content/uploads/2023/03/IMG_1324-768x404.jpg 768w, https://blog.ovhcloud.com/wp-content/uploads/2023/03/IMG_1324.jpg 1199w" sizes="auto, (max-width: 512px) 100vw, 512px" /></figure>



<h4 class="wp-block-heading" id="Remotestorageplayground-Context">Context</h4>



<p>After you have identify one (or more) remote storage who might suit your must bench it. However it is not as straight forward as it seems. Let&#8217;s review what we will need for this experiment:</p>



<ul class="wp-block-list">
<li>A (scalable) remote storage, in our case one which is remote write</li>



<li>One or more data generator</li>
</ul>



<h3 class="wp-block-heading" id="Remotestorageplayground-IntroducingHachimon">Introducing Hachimon</h3>



<figure class="wp-block-image alignright size-full is-resized"><img loading="lazy" decoding="async" src="https://blog.ovhcloud.com/wp-content/uploads/2023/03/IMG_1322.png" alt="Hachimon path" class="wp-image-24832" width="277" height="213" srcset="https://blog.ovhcloud.com/wp-content/uploads/2023/03/IMG_1322.png 554w, https://blog.ovhcloud.com/wp-content/uploads/2023/03/IMG_1322-300x231.png 300w" sizes="auto, (max-width: 277px) 100vw, 277px" /></figure>



<p>Benchmarking is always fun but you know what is even more fun? Gamification! With my team mates we have created a short benchmark plan which we have called the <a href="https://narutofanon.fandom.com/wiki/Hachimon" rel="nofollow external noopener noreferrer" data-wpel-link="external" target="_blank">Hachimon path</a>:</p>



<ul class="wp-block-list">
<li>Gate of Opening
<ul class="wp-block-list">
<li>1k targets</li>



<li>1000 series/target</li>



<li>~ 66k datapoints/sec</li>
</ul>
</li>



<li>Gate of Healing
<ul class="wp-block-list">
<li>2k targets</li>



<li>1000 series/target,</li>



<li>~133k datapoints/sec</li>
</ul>
</li>



<li>Gate of Life
<ul class="wp-block-list">
<li>4k targets</li>



<li>1000 series/target</li>



<li>~266k datapoints/sec</li>
</ul>
</li>



<li>Gate of Pain
<ul class="wp-block-list">
<li>4k targets</li>



<li>1000 series/target</li>



<li>~266k datapoints/sec after deduplication</li>



<li>dual prometheus to increase pressure on deduplication features</li>
</ul>
</li>



<li>Gate of Limit
<ul class="wp-block-list">
<li>4k targets</li>



<li>2500 series/target to increase pressure on storage</li>



<li>~660k datapoints/sec</li>



<li>dual prometheus</li>
</ul>
</li>



<li>Gate of View
<ul class="wp-block-list">
<li>8k targets</li>



<li>2500 series/target</li>



<li>~1.3M datapoints/sec</li>



<li>dual prometheus</li>
</ul>
</li>



<li>Gate of Wonder
<ul class="wp-block-list">
<li>10k targets</li>



<li>2500 series/target</li>



<li>~1.6M datapoints/sec</li>



<li>dual prometheus</li>
</ul>
</li>



<li>Gate of Death
<ul class="wp-block-list">
<li>Add as many targets as you can until the backend almost on fire</li>
</ul>
</li>
</ul>



<p>To walk the Hachimon path we&#8217;ve built an infrastructure where only the central piece, the remote storage, changes. Doing so help us compare results.</p>



<p>The write path is stress by one or more Prometheus clusters which will scrap many time the same <a href="https://github.com/prometheus/node_exporter" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external">node_exporter</a> under a different set of labels. Doing so allow us to emulate an infrastructure bigger than it is. To increase the cardinality we can tweak node_exporter configuration to expose more or less series. By deploying one or more Prometheus clusters we can both stress the deduplication feature of the backend and workaround the hardware limitation of a given prometheus.</p>



<p>This approach is very similar to the one of <a href="https://valyala.medium.com/promscale-vs-victoriametrics-resource-usage-on-production-workload-91c8e3786c03" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external">Victoriametrics</a> which has inspired us. Kudos!</p>



<p>By the time we have reach the end of our tests the infrastucture we have built looks like the following:</p>



<figure class="wp-block-image"><img decoding="async" src="https://raw.githubusercontent.com/wilfriedroset/remote-storage-wars/master/assets/generic-infrastructure.png" alt=""/></figure>



<p>This is the infrastucture we have used to bench both the read and the write path of the remote storages. There is load balancing on both side, multiple pairs of Prometheus to put more or less pressure on the write path and the deduplication. Finally, the data comes from little instances exposing node_exporter metrics.</p>



<h3 class="wp-block-heading" id="Remotestorageplayground-Expectation">Expectation</h3>



<p>Thanks to this benchmarking plan we have been able to differentiate the remote storage on a performance perspective. We&#8217;ve been able to get a first understanding about how each remote storage works, how to tune them and what can you done and what you cannot with them. It seems to us that it is equally important to have ease to operate a solution and good performance. But most importantly we learnt a lot of thing while having fun.</p>



<h3 class="wp-block-heading" id="Remotestorageplayground-Conclusion">Conclusion</h3>



<p>This benchmarking plan&#8217;s s obviously flawned in many ways:</p>



<ul class="wp-block-list">
<li>it&#8217;s expensive as you need to spawn more than necessary to assess a particular point of your remote storage.</li>



<li>it&#8217;s hard to reproduce 100% the same setup, even with the same configuration and software version you will have a similar result but not exactly the same.</li>



<li>you&#8217;re not always benchmarking what you think you are. We have spent couple of time troubleshoot performance issue which where in <a href="https://github.com/prometheus/prometheus/issues/9807" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external">Prometheus</a> or haproxy configuration.</li>



<li>it focus mainly on the write path without stress from the read path which is not realistic.</li>
</ul>



<p>The two next posts of this series continue to focus on benchmarking. The first one focus on the read performance.</p>



<p>The second one focus on how we should have benchmarked our solution from the beginning.</p>



<p>Stay tuned</p>
<img loading="lazy" decoding="async" src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fprometheus-remote-storage-playground%2F&amp;action_name=Prometheus%26%238217%3B%20remote%20storage%20playground&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Welcome to Prometheus world of remote storage</title>
		<link>https://blog.ovhcloud.com/welcome-to-prometheus-world-of-remote-storage/</link>
		
		<dc:creator><![CDATA[Wilfried Roset]]></dc:creator>
		<pubDate>Thu, 16 Feb 2023 16:29:25 +0000</pubDate>
				<category><![CDATA[OVHcloud Engineering]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Observability]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[prometheus]]></category>
		<guid isPermaLink="false">https://blog.ovhcloud.com/?p=24579</guid>

					<description><![CDATA[At OVHcloud, we recently made a change to our internal Observability stack. After testing and comparing the different solutions on the market, we opted for on open source solution. With this blog post, we&#8217;re starting a series of articles to provide feedback on our selection process and what we&#8217;ve learned along the way. Our mission [&#8230;]<img src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fwelcome-to-prometheus-world-of-remote-storage%2F&amp;action_name=Welcome%20to%20Prometheus%20world%20of%20remote%20storage&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></description>
										<content:encoded><![CDATA[
<p><em>At OVHcloud, we recently made a change to our internal Observability stack. After testing and comparing the different solutions on the market, we opted for on open source solution. With this blog post, we&#8217;re starting a series of articles to provide feedback on our selection process and what we&#8217;ve learned along the way. Our mission was to find  an horizontally scalable, highly available, multi-tenant, long-term storage for Prometheus, we begin this series with an introduction to Prometheus remote storage…</em></p>



<p>Over the last decade Prometheus has become one of the standard for Observability. It&#8217;s core concept is well suited for today technological use cases and it makes sense that open source community loves it. While Prometheus does a lot of thing really well when it comes to long term storage users must find a solution. This blog post serie discuss Prometheus&#8217;s remote storages, the technical challenges they aim to solve and more importantly we discuss how to pick the right one for <strong>you</strong>.</p>



<figure class="wp-block-image aligncenter size-large is-resized"><img decoding="async" src="https://blog.ovhcloud.com/wp-content/uploads/2023/02/logo-article-prometheus2-1024x542.jpg" alt="Prometheus love remote storage" class="wp-image-24617" width="640" srcset="https://blog.ovhcloud.com/wp-content/uploads/2023/02/logo-article-prometheus2-1024x542.jpg 1024w, https://blog.ovhcloud.com/wp-content/uploads/2023/02/logo-article-prometheus2-300x159.jpg 300w, https://blog.ovhcloud.com/wp-content/uploads/2023/02/logo-article-prometheus2-768x407.jpg 768w, https://blog.ovhcloud.com/wp-content/uploads/2023/02/logo-article-prometheus2.jpg 1194w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading">What is a remote storage?</h2>



<p>Prometheus can be configured to read or write to a remote storage on top of its local storage. This allow it to support long-terme storage of users data. The two features are called&nbsp;<a href="https://prometheus.io/docs/operating/configuration/#remote_read" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external">remote_read</a> and <a href="https://prometheus.io/docs/operating/configuration/#remote_write" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external">remote_write</a>.</p>



<p>With remote_read configured, Prometheus will answer read queries with data from the remote storage. The remote_write is responsible for shipping samples to the remote storage. Both of them are extremely useful and highly configurable.For the rest of this blog post let&#8217;s focus on remote write.</p>



<p>Whether you are a cloud provider or building an in-house Observability it is not always appropriate nor possible to connect to your customers infrastructure to extract data.</p>



<p>With a remote write approach customers can have a strict control on what comes in/out of the infrastructure. We could argue that IPtables coupled with authentication is secure enough but this is still one more door to keep an eye on. With tight security taken into account we understand that remote write makes a lot of sense from a service provider point of view.</p>



<p>Now that we know that we want a remote write compatible storage we must take into account that not all remote storages are equal. The list of solution keeps growing every day, let&#8217;s see if we can differentiate them.</p>



<p>When writing metrics to a remote storage it is because we want to read then back later. Most Observability use cases imply writing down tons of data that will be queried afterwards. PromQL is the query language use to query Prometheus and therefore associated remote storage. It would make sense to check how PromQL compliant the solutions are. Fear not, Prometheus community is already tackling this question for us with <a href="https://promlabs.com/promql-compliance-tests/" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external">PromQL Compliance</a></p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="621" src="https://blog.ovhcloud.com/wp-content/uploads/2023/02/image-1024x621.png" alt="" class="wp-image-24580" srcset="https://blog.ovhcloud.com/wp-content/uploads/2023/02/image-1024x621.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2023/02/image-300x182.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2023/02/image-768x466.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2023/02/image-1536x932.png 1536w, https://blog.ovhcloud.com/wp-content/uploads/2023/02/image-2048x1243.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">PromQL Compliance results as of 2021-10-14</figcaption></figure>



<p>As you can, see most remote storage are 100% compliant with Prometheus results. Good news. This means users have a plethora of </p>



<p>However, readers must not under estimate this point. Indeed compliance impacts what you can query from the backend, how you can query it and, the accuracy of a result. It might not be trivial to reach full compliance and to stay compliant. Maintainers might also choose to not be compliant and explain <a href="https://medium.com/@romanhavronenko/victoriametrics-promql-compliance-d4318203f51e" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external">why</a>.</p>



<p>Prometheus world grows in adoption and under active development. If a solution is compatible today there is no guarantee it&#8217;ll stay compatible tomorrow.</p>



<p>Which bring us to the second point, the community. How healthy, large and active are the community behind each software?<br>Is it easy to contact them? Discuss issues? Propose feature and PRs? We tend to take granted the fact that PRs will be reviewed, that we&#8217;ll found someone to help us troubleshoot a bug but this is not necessarily the case.</p>



<h3 class="wp-block-heading">Features set</h3>



<p>To better address the technical challenges that are your own you must pick the solution that have the features you need. If you need multi tenancy check that point. If you need to downsample your data add this to your checklist. Don&#8217;t be shy, dig a little deeper. Test the feature look for its limitation. Tests are the only way to be able to make an informed decision. </p>



<p>To give you an idea you might want to have a look at the following features:   </p>



<ul class="wp-block-list">
<li>multi tenancy</li>



<li> rate limiting</li>



<li>deduplication</li>



<li>deletion</li>



<li>downsampling</li>
</ul>



<h3 class="wp-block-heading">Scalability</h3>



<p>Nowadays the word scalability is present almost everywhere. How well each remote storage scale? Can you write 2M samples/sec? Can you answer 1M queries/sec? Can you have 200M active series in total? <a href="https://grafana.com/blog/2022/04/08/how-we-scaled-our-new-prometheus-tsdb-grafana-mimir-to-1-billion-active-series/" rel="nofollow external noopener noreferrer" data-wpel-link="external" target="_blank">1B active series</a>? Per tenant?</p>



<p>You can have a rough understanding of the bottleneck by looking at the architecture diagram. But to have a crystal clear answer there is only one way, you need to make a proof of concept.</p>



<p>By the way, you can even try one remote storage right now on our <a href="https://www.ovhcloud.com/en/public-cloud/kubernetes" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external">managed k8s</a>. Most of the open source remote storage offer helm charts or operator to do so: <a href="https://github.com/VictoriaMetrics/helm-charts" rel="nofollow external noopener noreferrer" data-wpel-link="external" target="_blank">VictoriaMetrics</a>, <a href="https://github.com/timescale/helm-charts" rel="nofollow external noopener noreferrer" data-wpel-link="external" target="_blank">Timescale</a>, <a href="https://github.com/grafana/mimir/tree/main/operations/helm/charts/mimir-distributed" rel="nofollow external noopener noreferrer" data-wpel-link="external" target="_blank">Mimir</a>.</p>



<h3 class="wp-block-heading">Cost</h3>



<p>Along scalability comes <em>tco</em> which stand for <em>Total Cost of Ownership</em>. This boil down to how expensive a solution, infrastructure can be when you take all cost into account. For remote storage, on top of the team operating the infrastructure we must take into account the aforementioned infrastructure. All technical solution relies on 4 categories: trained engineers, compute resources, network and&#8230; Storage. Nevertheless, it is critical to take it into account all aspect of the target solution. Otherwise be ready for a surprise at the end of the month.</p>



<h2 class="wp-block-heading">Conclusion</h2>



<p>As we have demonstrate, we have a lot of technical solutions to address long term storage. However before putting one solution in production we need to thoroughly identify and assess all trade offs. In the next posts we will have a look on how to get to know your remote storage, bench it, break it.</p>
<img loading="lazy" decoding="async" src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fwelcome-to-prometheus-world-of-remote-storage%2F&amp;action_name=Welcome%20to%20Prometheus%20world%20of%20remote%20storage&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Explaining slow queries to my manager</title>
		<link>https://blog.ovhcloud.com/explaining-slow-queries-to-my-manager/</link>
		
		<dc:creator><![CDATA[Wilfried Roset]]></dc:creator>
		<pubDate>Fri, 13 Mar 2020 14:46:52 +0000</pubDate>
				<category><![CDATA[OVHcloud Engineering]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<guid isPermaLink="false">https://www.ovh.com/blog/?p=17232</guid>

					<description><![CDATA[In our previous blog post about observability, we explained how to build a comprehensive view of how your SQL workloads behave, and the many reasons why it is important to have this view. In this blog post, we will take a closer look into the four types of SQL query, and how they can impact [&#8230;]<img src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fexplaining-slow-queries-to-my-manager%2F&amp;action_name=Explaining%20slow%20queries%20to%20my%20manager&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></description>
										<content:encoded><![CDATA[
<p>In our <a href="https://www.ovh.com/blog/improve-your-sql-workload-with-observability/" data-wpel-link="exclude">previous blog post about observability</a>, we explained how to build a comprehensive view of how your SQL workloads behave, and the many reasons why it is important to have this view. In this blog post, we will take a closer look into the four types of SQL query, and how they can impact the end user&#8217;s experience.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="537" src="https://www.ovh.com/blog/wp-content/uploads/2020/03/FC56BF30-9E86-4E5F-939E-D995E0A189A4-1024x537.png" alt="" class="wp-image-17550" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/03/FC56BF30-9E86-4E5F-939E-D995E0A189A4-1024x537.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2020/03/FC56BF30-9E86-4E5F-939E-D995E0A189A4-300x157.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2020/03/FC56BF30-9E86-4E5F-939E-D995E0A189A4-768x403.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2020/03/FC56BF30-9E86-4E5F-939E-D995E0A189A4.png 1200w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>Before going further, let us recapitulate what these four types of queries are:</p>



<ul class="wp-block-list"><li><strong>Select</strong> is for reading data</li><li><strong>Insert</strong> is for adding data</li><li><strong>Update</strong> is for&nbsp;changing data that already exists</li><li><strong>Delete</strong> is for deleting data</li></ul>



<pre class="wp-block-code"><code class="">my-database=# select * from customers where nic = XXX;
my-database=# insert into customers values (1, 'user-firstname', 'user-lastname', '21');
my-database=# update customers set address = 'xxx xxx' where nic = 'XXX';
my-database=# delete from customers where nic = XXX</code></pre>



<p>When it comes to SQL workloads, there are two different types: <strong>OLTP</strong> and <strong>OLAP</strong>.</p>



<h4 class="wp-block-heading">OLTP workloads</h4>



<p>OLTP (for <strong>O</strong>n<strong>L</strong>ine <strong>T</strong>ransactional <strong>P</strong>rocess) workloads correspond to the &#8220;organic&#8221; use of databases. These   operations are used to make more effective use of the databases behind websites, APIs, e-commerce platforms etc. While OLAP&nbsp;relies exclusively on read, OLTP workloads&nbsp;rely on all types of queries, including select, insert, update, and delete. With OLTP, we want the queries to reply as fast as possible, generally in under a few hundred milliseconds. The reason behind this need for speed is to reduce the impact queries will have on your application&#8217;s user experience. After all, who loves websites that take forever to load? In terms of the number of queries, we usually count them in thousands per second. </p>



<pre class="wp-block-code"><code class="">my-database=# insert into cart values (...); -- create a new cart
my-database=# insert into cart_content values (...); -- add items
my-database=# update cart_content set ... where ...; -- modify your cart
my-database=# select item_name, count from cart_content where ...; -- check the content
my-database=# insert into sales values (...); -- validate the cart</code></pre>



<h4 class="wp-block-heading">OLAP workload</h4>



<p>OLAP (for <strong>O</strong>n<strong>L</strong>ine <strong>A</strong>nalytic <strong>P</strong>rocess) workloads are used to extract and analyse huge volumes of data (hence the name). They are the main tool used by business intelligence software platforms to produce forecasts and reports. In terms of queries,&nbsp;OLAP workloads usually rely exclusively on a few select ones that are periodically executed, and can take a long time (from minutes to hours) to complete.</p>



<p>As you can see, OLTP and OLAP workloads are very different.&nbsp;Comparing them is like comparing a racecar (OLTP, hopefuly) to a truck (OLAP).</p>



<h3 class="wp-block-heading">Classifying queries: the good, the bad, the ugly&#8230; and the slow</h3>



<p>Now that we have a general understanding of the two types of workloads, let us focus on OLTP, as they are usually the most relevant to the customer-facing parts of your platforms. At the beginning of this post, I described the four different types of SQL queries in terms of their purpose.&nbsp;Now, we&#8217;ll classify them according to their behaviour: good, bad, ugly and slow. What does that mean, you ask? Let me explain (spoiler: you want your queries to fall in the &#8220;good&#8221; category)&#8230;</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="530" src="https://www.ovh.com/blog/wp-content/uploads/2020/03/3582020E-9B99-4195-ABD7-6E90FE4B2C9B-1024x530.png" alt="" class="wp-image-17547" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/03/3582020E-9B99-4195-ABD7-6E90FE4B2C9B-1024x530.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2020/03/3582020E-9B99-4195-ABD7-6E90FE4B2C9B-300x155.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2020/03/3582020E-9B99-4195-ABD7-6E90FE4B2C9B-768x398.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2020/03/3582020E-9B99-4195-ABD7-6E90FE4B2C9B.png 1466w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h4 class="wp-block-heading">The good</h4>



<p>As you would expect, good queries are the ones that run as expected and reply relatively fast. At OVHcloud, we define &#8220;fast&#8221; as a response time of lower than one second for our internal databases. But one second is still a long time to wait for a response, especially when multiple queries are made to load a single web page.  Generally, we aim for 10-20ms. You should draw this &#8220;fast-line&#8221;  depending on your setup, resources, and intended usecase.</p>



<p>Your backend will query the database and get an answer in, let&#8217;s say, 20ms, which will leave plenty of time to process the data and send a result. The faster your queries runs, the happier your customers and boss will be.</p>



<p>When I want to explain to my boss why fast queries are good, it is pretty  simple: fast queries mean good user experience, fast order, fast  checkout, and more profit.</p>



<pre class="wp-block-code"><code class="">my-database=# select firstname, lastname from customers where id = 123;</code></pre>



<h4 class="wp-block-heading">The bad</h4>



<p>Bad queries, on another hand, are queries that can not be executed by
 the DBMS. There can be multiple reasons for that: bug in the code, lack
 of control somewhere in the process etc&#8230;</p>



<p>Let&#8217;s take an example. Your website has a form where users can create an account, in which they provide their age. In the UI, the text box lets the user type in whatever they want and passes the value as a string. But if your schema is well-designed, it should expect an integer in the &#8220;age&#8221; field. This way, if a user tries to type their age as a string in the box rather than as a number, the DBMS should return an error. The solution is simple: the UI form should check the type of data filled in the box and return an error message, such as &#8220;invalid data&#8221;, at the UI front-end, instead of waiting for the DBMS to do so. In cases like this, it would be advisable to only allow numbers.</p>



<pre class="wp-block-code"><code class="">my-database=# insert into user values (1, 'user-firstname', 'user-lastname', 'twenty years old');
ERROR:  invalid input syntax for integer: "twenty years old"</code></pre>



<p>You can fix this type of &#8220;bad&#8221; query by adding more control through the chain, using the correct type in the UI, with checks in the front-end, middle-ware, back-end, and so on.</p>



<p>To my boss, I would explain that bad queries are a hindrance to customers wanting to use your service, and will lead to a loss of profit. However, because of their straightforward nature, they are usually relatively easy to debug.</p>



<h4 class="wp-block-heading">The ugly</h4>



<p>Ugly queries are more problematic. They are queries that sometimes work, sometimes don&#8217;t because of deadlocks.</p>



<p>Deadlock is a vast subject, but for now let&#8217;s keep it simple. A deadlock happens when multiple queries are waiting for each other to finish. Let&#8217;s look at the following example:</p>



<pre class="wp-block-code"><code class="">-- STEP #1
process 1: BEGIN; -- this will start the transaction
process 2: BEGIN;
 
-- STEP #2
process 1: UPDATE stock SET available = 10 WHERE id = 123; -- lock row 123
process 2: UPDATE stock SET available = 0 WHERE id = 456; -- lock row 456
 
-- STEP #3 The ugly part starts now
process 1: UPDATE stock SET available = 1 WHERE id = 456; -- wait for lock on row 456
process 2: UPDATE stock SET available = 9 WHERE id = 123; -- wait for lock on row 123</code></pre>



<p>We can see that we have two processes trying to update the stock within a transaction. Processes #1 and #2 are each locking a different row. Process #1 is locking row 123, while process #2 is locking row 456 in step 2. In step 3, without releasing the lock on its current row, process #1 tries to acquire a lock on row 456, which is already  owned by process #2, and vice versa. To complete their transaction, they are both waiting on each other. I have chosen a simple example with only two queries, but this problem can happen with tens or thousands of queries at the same time. A general rules when working with transactions is to commit them as fast as possible.</p>



<p>The difficulty is that the query can be perfectly correct and work most of the time, especially in your CI/CD pipeline, where corner cases and rare events are not necessarily identified and tested. But the more your business grows, the likelier these rare events are to happen, as you increase the number of concurrent queries made.&nbsp;And  unfortunately, the likeliest time for deadlocks issues is during load peaks caused by sales, holidays, etc. In other words, exactly when you need your workflow to work perfectly.</p>



<p>To explain that to my boss, I would say that when deadlock happen, there is either something wrong in the backend, the database schema, or in the workflow logic itself. In a worst-case scenario, the problem will hit at the most incovenient moment, so the customer will be unable to interact with your system, and not even receive an understandable error message, which will be hard to fix.&nbsp;Deadlocks take time to understand, debug and fix. By the time you have prodded the fix, your customers will be spending their money elsewhere, or your support will be crumbling under tickets and calls.</p>



<pre class="wp-block-code"><code class="">process 34099 detected deadlock while waiting for ShareLock on transaction 4026716977 after 1000.042 ms
DETAIL: Process holding the lock: 34239. Wait queue: .
CONTEXT: while locking tuple (259369,24) in relation "table"
STATEMENT: SELECT col from table where ...</code></pre>



<p>Your favourite DBMS will eventually kill all queries, but only after a given timeout. And of course, timeout means your customers will wait for the result before ending up with an error.&nbsp;Yeah, this is ugly&#8230;</p>



<h4 class="wp-block-heading">And the slow&#8230;</h4>



<p>Finally, as you can probably imagine, slow queries are queries that take time to finish. They are very easy to describe, but not that easy to fix, and improving them should be an ongoing effort. Here are some common causes  of slow queries:</p>



<ul class="wp-block-list"><li>Poorly written queries (but you don&#8217;t have this in prod, do you?)</li><li>Missing indexes</li><li>Fetching too many rows</li><li>Too much data to go through</li></ul>



<p>For this one, my boss doesn&#8217;t need an explanation. Slow queries mean slower API calls, slower UI and fewer customers reaching the checkout stage.</p>



<p>The fix can be straight forward: rewrite your queries, find and add missing indexes, and fetch only what is needed.&nbsp;However, reducing the amount of data your queries have to go through is a little bit more difficult. It can be done through regular purges in your DB, archiving, partitioning, etc. But in practice, you should only keep hot and relevant data in your customer-facing databases to avoid bloat.</p>



<h3 class="wp-block-heading">Conclusion</h3>



<p>Let&#8217;s wrap up and summarise:</p>



<ul class="wp-block-list"><li>Good queries are a sign of a healthy workload. The more you have, the better it is</li><li>Bad queries mean that something is broken somewhere</li><li>Ugly queries are waiting for the worst possible moment to slap you</li><li>Slow queries mean that you have something working, but there is room for improvement</li></ul>



<p>One last tip&#8230; this is not a one-time job. You need to keep a close eye on those four query categories. </p>



<p>That&#8217;s it folks! You now know enough to dig into your applications and databases to continuously improve your  workloads. Ultimately, your customers are impacted by all four categories, so I&#8217;m sure that you know why you only want good queries in your information systems!</p>
<img loading="lazy" decoding="async" src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fexplaining-slow-queries-to-my-manager%2F&amp;action_name=Explaining%20slow%20queries%20to%20my%20manager&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Improve your SQL workload with observability</title>
		<link>https://blog.ovhcloud.com/improve-your-sql-workload-with-observability/</link>
		
		<dc:creator><![CDATA[Wilfried Roset]]></dc:creator>
		<pubDate>Fri, 24 Jan 2020 12:26:19 +0000</pubDate>
				<category><![CDATA[OVHcloud Engineering]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<guid isPermaLink="false">https://www.ovh.com/blog/?p=16269</guid>

					<description><![CDATA[Our team of database administrators used to be&#160;overwhelmed by our developers&#8217; needs. Picture this: we had only 1.5 database admins per more than 400 tech people (DevOps, developers etc.), with only 24 hours in a day! This was a perfect use-case for observability. But what is observability, apart from a buzzword? To me, observability is [&#8230;]<img src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fimprove-your-sql-workload-with-observability%2F&amp;action_name=Improve%20your%20SQL%20workload%20with%20observability&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></description>
										<content:encoded><![CDATA[
<p>Our team of database administrators used to be&nbsp;overwhelmed by our developers&#8217; needs. Picture this: we had only 1.5 database admins per more than 400 tech people (DevOps, developers etc.), with only 24 hours in a day! This was a perfect use-case for observability.<br><br>But what is <strong>observability</strong>, apart from a buzzword?  To me, observability is not only a set of tools designed to collect data (logs, metrics &#8230;) but also &#8211; and more importantly &#8211; the value that you extract from this data and how you act on it. This goes far beyond simple dashboards or other visualisation tools.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="537" src="https://www.ovh.com/blog/wp-content/uploads/2020/01/E3645F58-271C-4857-98A8-EE8D4EAAD5C7-1024x537.jpeg" alt="Improve your SQL workload with Observability" class="wp-image-16795" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/01/E3645F58-271C-4857-98A8-EE8D4EAAD5C7-1024x537.jpeg 1024w, https://blog.ovhcloud.com/wp-content/uploads/2020/01/E3645F58-271C-4857-98A8-EE8D4EAAD5C7-300x157.jpeg 300w, https://blog.ovhcloud.com/wp-content/uploads/2020/01/E3645F58-271C-4857-98A8-EE8D4EAAD5C7-768x403.jpeg 768w, https://blog.ovhcloud.com/wp-content/uploads/2020/01/E3645F58-271C-4857-98A8-EE8D4EAAD5C7.jpeg 1200w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure></div>



<p>If you remember our <a href="https://www.ovh.com/blog/ovhclouds-internal-databases-infrastructure/" data-wpel-link="exclude">first blog post</a>, you will know that a single cluster can host multiple databases, potentially from different applications. Therefore, an application can have an impact on an unrelated application, by using the SQL service.</p>



<h3 class="wp-block-heading">Let&#8217;s begin with some examples</h3>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="546" src="https://www.ovh.com/blog/wp-content/uploads/2020/01/88480DF8-A352-4549-981D-18A9F1B3404D-1024x546.jpeg" alt="" class="wp-image-16790" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/01/88480DF8-A352-4549-981D-18A9F1B3404D-1024x546.jpeg 1024w, https://blog.ovhcloud.com/wp-content/uploads/2020/01/88480DF8-A352-4549-981D-18A9F1B3404D-300x160.jpeg 300w, https://blog.ovhcloud.com/wp-content/uploads/2020/01/88480DF8-A352-4549-981D-18A9F1B3404D-768x410.jpeg 768w, https://blog.ovhcloud.com/wp-content/uploads/2020/01/88480DF8-A352-4549-981D-18A9F1B3404D.jpeg 1520w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure></div>



<p>In the example <em>Situation 1</em>, <em>DB-A</em> and <em>DB-B</em> &#8211; which are respectively accessed by <em>APP-A</em> and <em>APP-B</em> &#8211; share a cluster named <em>SQL-1</em>. <em>APP-A</em> can indirectly have an impact on <em>APP-B</em>. </p>



<p>So why not just provision one cluster per database? Well, firstly that would be quite extensive since most databases don&#8217;t require that much performance. But that wouldn&#8217;t even solve all the issues: now imagine the situation on the example <em>Situation 2</em>, where <em>APP-A</em> accesses both <em>DB-A</em> <em>and</em> <em>DB-B</em>. Then database <em>DB-B</em> itself is shared between <em>APP-A</em> and <em>APP-B</em>. </p>



<p>It can be a nightmare to totally split and isolate everything. That&#8217;s why we prefer to fix the root cause: the behaviour of our applications.</p>



<h3 class="wp-block-heading">Observability to improve the behavior of the databases</h3>



<p>Being a good database administrator and improving how applications behave with databases requires several things: a good understanding of the business use case behind the application, knowledge of the different technical trade-offs behind your application and your databases parameters, and information about your database&#8217;s health.</p>



<p>And here comes observability: we need to have data about our databases. We have two data sources: logs and metrics. To collect logs we use a combination of syslog, <a href="https://www.elastic.co/products/beats/filebeat" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">filebeat</a> on one side and <a href="https://www.ovh.com/fr/data-platforms/logs/" data-wpel-link="exclude">OVHcloud logs Data Platform</a> on the other side. For the metrics part we use <a href="https://github.com/influxdata/telegraf" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">telegraf</a> and <a href="https://www.ovh.com/fr/data-platforms/metrics/" data-wpel-link="exclude">OVHcloud metrics</a>.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="924" height="927" src="https://www.ovh.com/blog/wp-content/uploads/2020/01/C832F9AB-A9D2-4BC8-AD92-76085B666D7C.jpeg" alt="" class="wp-image-16793" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/01/C832F9AB-A9D2-4BC8-AD92-76085B666D7C.jpeg 924w, https://blog.ovhcloud.com/wp-content/uploads/2020/01/C832F9AB-A9D2-4BC8-AD92-76085B666D7C-300x300.jpeg 300w, https://blog.ovhcloud.com/wp-content/uploads/2020/01/C832F9AB-A9D2-4BC8-AD92-76085B666D7C-150x150.jpeg 150w, https://blog.ovhcloud.com/wp-content/uploads/2020/01/C832F9AB-A9D2-4BC8-AD92-76085B666D7C-768x770.jpeg 768w" sizes="auto, (max-width: 924px) 100vw, 924px" /></figure></div>



<h3 class="wp-block-heading">Industrializing the analysis</h3>



<p>A database administrator will usually perform analysis on demand, but human interventions are difficult to scale. Therefore, we had to industrialise this analysis wherever possible. </p>



<p>Fortunately for us, we have tools at our disposal for this. The&nbsp;first (and easiest) thing we have industrialised (and the easiest one) was the analysis of our logs. <a href="https://github.com/darold/pgbadger" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">PGBadger</a> and <a href="https://www.percona.com/software/database-tools/percona-toolkit" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">pt-query-digest from Percona toolkit</a> provided us with everything we needed.</p>



<p>I will not focus here on how to get the data itself as that topic is already well covered. I&#8217;d rather explain to you what we do with this freshly-collected data.</p>



<h4 class="wp-block-heading">Dashboards</h4>



<p>Obviously &#8211; and in spite of what I told you earlier &#8211; the first thing we did was to build dashboards. To do that, we used Grafana to display information stored in OVHcloud Logs and Metrics data platforms in a single dashboard. Grafana is extremely powerful for this. This gives us the same dashboard information from logs and metrics.</p>



<p>Building dashboards was the easy part: system information (CPU, RAM, load, disk space), I/O (disk and network) and DBMS (transactions per second, SQL or syntax errors, and more interestingly, deadlocks and slow queries). In the later one, we can see the number of transactions per second with different granularity, SQL error, invalid syntax, deadlocks and slow queries.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="333" src="https://www.ovh.com/blog/wp-content/uploads/2020/01/4C3B3A20-5F03-4409-BAF2-0FE8BC660328.png" alt="" class="wp-image-16800" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/01/4C3B3A20-5F03-4409-BAF2-0FE8BC660328.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2020/01/4C3B3A20-5F03-4409-BAF2-0FE8BC660328-300x98.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2020/01/4C3B3A20-5F03-4409-BAF2-0FE8BC660328-768x250.png 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h4 class="wp-block-heading">Deadlocks and slow queries</h4>



<p>Let me explain what I mean exactly by deadlock and slow queries:</p>



<ul class="wp-block-list"><li>A deadlock happens when two or more queries wait on each other to complete. They are eventually killed by the DMBS leaving only one.</li><li>Slow queries are exactly what you think: queries that take more than a certain fixed duration to complete.</li></ul>



<p>&nbsp;In our case we consider a query slow if it lasts longer than 1 second. If you are concerned with the behaviour and performance of your application, this is where you should dig.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="466" src="https://www.ovh.com/blog/wp-content/uploads/2020/01/8BE67B64-1E76-40C8-A15C-4CE4D0BC0595.png" alt="" class="wp-image-16799" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/01/8BE67B64-1E76-40C8-A15C-4CE4D0BC0595.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2020/01/8BE67B64-1E76-40C8-A15C-4CE4D0BC0595-300x137.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2020/01/8BE67B64-1E76-40C8-A15C-4CE4D0BC0595-768x350.png 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>So what do we do with this information? Simple: we share it, with every OVHcloud employee on our tech-related mailing Lists. And then we could start thinking about how to exploit all this information.</p>



<h3 class="wp-block-heading">Do it yourself as a DBA</h3>



<p>We try to fix the issues that come to our attention through this means. We first focus on slow queries because you can fix them in several ways, either by fixing the schema or fixing the application. Because we &#8211; <em>as DBAs</em> &#8211; don&#8217;t have any control over the application, we do our best to fix the schemas. But this is an endless job that doesn&#8217;t scale: we have hundreds of databases for thousands of applications. Then we repeat this process for the other types of queries like deadlocks.</p>



<h3 class="wp-block-heading">Open issues in the concerned teams&#8217;s backlog</h3>



<p>After that, we tried to open issues in the backlog of the teams who were responsible for applications suffering from slow queries. Again, that didn&#8217;t scale as we can&#8217;t spend a significant amount of time opening defects in a backlog we don&#8217;t have control of. </p>



<h3 class="wp-block-heading">Understand that we as DBAs can&#8217;t scale if we do it alone</h3>



<p>We took a step back and thought about what we wanted to achieve: our goal was not to babysit developers, it was to empower them and help them do their jobs by providing them with documentation and information.</p>



<h3 class="wp-block-heading">Start documenting how to use these new tools</h3>



<p>Writing good and comprehensive documentation is hard, so that&#8217;s where we started: how to access the dashboards we created, what they mean, what patterns are negative and should be avoided and so on. While the initial effort has been done, it is a continuous effort and we strive to improve it day after day.</p>



<h3 class="wp-block-heading">Advertise</h3>



<p>After  documentation, came the second, more difficult step: communication. At  first, we took time to discuss with each team when we noticed something was wrong, but it took us too much time and again &#8211; it didn&#8217;t scale. But talking to the developers gave us a great idea: what if we could make them actively want to settle these issues rather than going to them one team at a time? And that is when we decided to appeal to their pride and competitive spirit. </p>



<p>So we decided, at the beginning of each week, to publish a report sent to all tech people at OVHcloud summarising the most impressive improvements, the biggest offenders etc&#8230; This is the template we have been using for quite some time:</p>



<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>Hello</p><p>You will find information which can help you identify your queries in our welcome guide: [link to documentation]</p><p>If you need assistance to dig and fix your slow queries, feel free to ask: [link to procedure to ask for help]</p><p>Tldr:</p><p>* Database 94 has successfully fixed its slow queries</p><p>* Database 59 is our #1 producer of slow queries</p><p>* Database 75 is our #1 producer of deadlocks</p><p>* Database 33 is no more in TOP5, congrats</p><p>Please find below last week sql report.</p><p>MySQL slow queries/database<br>PostgreSQL slow queries/database<br>PostgreSQL error/database<br>PostgreSQL deadlock/database<br>&#8230;</p><p>W.</p></blockquote>
</div></div>



<p>At first, we feared that this report would have a rather cold reception. But the opposite occurred: people started to anticipate this weekly mail and started to compete with each other to decrease the amount of slow queries. Adding congratulations, gifs and personalised message helped a lot.</p>



<h3 class="wp-block-heading">In conclusion: it works!</h3>



<p>As I&#8217;m writing this post, nearly one year after we started doing these reports, our SQL workload has greatly improved thanks to the hard work of our developers. There are 5 times fewer slow queries than there used to be and we have almost no deadlock. Even better: we identify performance issues and bugs a lot faster and easier than before.&nbsp;And last, but certainly not least, trust and communication has been established between developers and database administrators, allowing us to work more closely to improve the responsiveness of our applications. That&#8217;s it for today, stay tuned!</p>
<img loading="lazy" decoding="async" src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fimprove-your-sql-workload-with-observability%2F&amp;action_name=Improve%20your%20SQL%20workload%20with%20observability&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Database replication 101</title>
		<link>https://blog.ovhcloud.com/database-replication-101/</link>
		
		<dc:creator><![CDATA[Wilfried Roset]]></dc:creator>
		<pubDate>Wed, 13 Nov 2019 13:31:26 +0000</pubDate>
				<category><![CDATA[OVHcloud Engineering]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<guid isPermaLink="false">https://www.ovh.com/blog/?p=16177</guid>

					<description><![CDATA[In our tour of OVHcloud&#8217;s Internal Databases Infrastructure, we showed you what our infrastructure looks like. This post will be about SQL replication, why it matters, and how we use it at OVHcloud. Nodes are not enough: they have to work together. To do that, we rely on a feature called replication to keep data [&#8230;]<img src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fdatabase-replication-101%2F&amp;action_name=Database%20replication%20101&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></description>
										<content:encoded><![CDATA[
<p>In our tour of <a href="https://www.ovh.com/blog/ovhclouds-internal-databases-infrastructure/" data-wpel-link="exclude">OVHcloud&#8217;s Internal Databases Infrastructure</a>, we showed you what our infrastructure looks like. This post will be about SQL replication, why it matters, and how we use it at OVHcloud.</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1024" height="536" src="https://www.ovh.com/blog/wp-content/uploads/2019/11/CA1E0C73-D3B2-4A4C-9BBC-4B8CF188F880-1024x536.jpeg" alt="" class="wp-image-16234" srcset="https://blog.ovhcloud.com/wp-content/uploads/2019/11/CA1E0C73-D3B2-4A4C-9BBC-4B8CF188F880-1024x536.jpeg 1024w, https://blog.ovhcloud.com/wp-content/uploads/2019/11/CA1E0C73-D3B2-4A4C-9BBC-4B8CF188F880-300x157.jpeg 300w, https://blog.ovhcloud.com/wp-content/uploads/2019/11/CA1E0C73-D3B2-4A4C-9BBC-4B8CF188F880-768x402.jpeg 768w, https://blog.ovhcloud.com/wp-content/uploads/2019/11/CA1E0C73-D3B2-4A4C-9BBC-4B8CF188F880.jpeg 1202w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>Nodes are not enough: they have to work together. To do that, we rely on a feature called <strong>replication</strong> to keep data in sync across all cluster nodes. With the replication feature enabled, all changes made on the primary node are propagated and applied to the rest of the cluster, so that the same data is stored on every node. When working with replication, there are certain trade-offs you have to be aware of. As there are several types of replication, we should first have a look at how replication works.</p>



<h3 class="wp-block-heading">Asynchronous replication</h3>



<p>The first one is called <strong>asynchronous replication</strong>. With this replication type, <strong>write queries are acknowledged as soon as the primary has executed them and stored the result on disk</strong>. The application can continue its work as soon as it receives this acknowledgment. In parallel, the changes are being propagated and applied to the rest of the cluster, which means that those changes won&#8217;t be visible on the replicas until they are fully propagated and applied. This also means that if you lose the primary before changes have been propagated, <strong>not-yet-propagated data will be lost</strong>.</p>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" decoding="async" width="512" height="229" src="https://www.ovh.com/blog/wp-content/uploads/2019/11/asynchronous-1.gif" alt="" class="wp-image-16223"/></figure></div>



<h3 class="wp-block-heading">Semi Synchronous replication</h3>



<p>The second one is called <strong>semi-synchronous replication</strong>. With this one, <strong>write queries are acknowledged as soon as the changes have been propagated to replicas</strong>. Propagated, but not necessarily applied: <strong>changes might not yet be visible on the replicas</strong>. But if the primary node is lost, replicas have all the data they need to apply the changes.</p>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" decoding="async" width="512" height="229" src="https://www.ovh.com/blog/wp-content/uploads/2019/11/semisynchronous.gif" alt="" class="wp-image-16224"/></figure></div>



<h3 class="wp-block-heading">Synchronous replication</h3>



<p>The last one is <strong>synchronous replication</strong>. The name is self-explanatory, but let us walk through how it works. In this mode, <strong>write queries are only acknowledged when changes have been propagated AND applied to the replicas</strong>. Obviously, this is the most secure way to replicate data: no data or progress is lost if there is a primary node failure.</p>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" decoding="async" width="512" height="229" src="https://www.ovh.com/blog/wp-content/uploads/2019/11/synchronous.gif" alt="" class="wp-image-16226"/></figure></div>



<h3 class="wp-block-heading">A real world example</h3>



<p>But a real example is worth a thousand technical explanations: Imagine you are running a website selling hand-made items. You have two customers and an item with a single piece remaining. Now imagine that the first customer is buying this last piece, and that the second customer checks availability at the exact same time that the first one is completing his purchase.</p>



<p>Buying an item is a write query as you need to update the stock, so you must perform it on the primary node. Displaying the webpage is a read query, so you decide to perform it on a replica node. What happens for the second customer if he/she displays the webpage at the same exact moment that the first customer receives the purchase confirmation? Does he see the item as in or out of stock. </p>



<p>As you will probably have guessed by now, <strong>it depends on the type of replication</strong> you have chosen for your database. With an asynchronous or semi-synchronous replication, the customer would see the item as still available. With a synchronous, she would see the item as out of stock.</p>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" decoding="async" width="550" height="909" src="https://www.ovh.com/blog/wp-content/uploads/2019/11/usecase-3.gif" alt="Database Replication example use case" class="wp-image-16242"/></figure></div>



<p>This can be confusing: this is always the case. The real difference between the modes here is that in the synchronous mode, the first customer&#8217;s purchase will take longer to complete (not complete before all replicas have applied the change). The logical difference is not between the time it takes for the change to be applied, it&#8217;s between when the first client sees her purchase completed.</p>



<p>Before going all in for synchronous replication <strong>you must take into account a crucial point: the latency</strong>. Indeed, waiting for all replicas to receive and apply the changes takes time. <strong>Latency impacts your website or application reactivity</strong>, and thus potentially your revenue. Indeed, multiple studies show that having a higher latency on purchase operations directly translates to fewer complete purchases, which you probably don&#8217;t want. </p>



<p>You might now get where I&#8217;m going with this: <strong>asynchronous replication operations take less time</strong> to complete and thus make your applications more reactive,<strong> but enable undesirable consequences</strong> like items appearing in stock when they are not.</p>



<p>As you can see, you choose either throughput and reactivity, or security. There is no right answer, <strong>it mostly depends on your use case</strong>. Fortunately some Database Management Systems (DBMS), such as <strong>PostgreSQL</strong>, allow you to define the level of security you want for a given query. This means you can use synchronous replication when a customer makes a purchase of at least $1000 and use asynchronous replication otherwise.</p>



<h3 class="wp-block-heading">And which method does OVHcloud use?</h3>



<p>At OVHcloud, we manage several <strong>mission critical databases</strong>, from <strong>banking transactions</strong>, to DNS parameters for all our domains names, or for our Public and Private Cloud<strong> Control Panels</strong>, information pushed by <strong>our APIs</strong>, and so on. We opted for <strong>asynchronous replication</strong> for all our databases. We cope with asynchronous disadvantages <strong>by reducing the latency as much as possible</strong>, making it negligible. <strong>Moreover our developers are&nbsp;experienced and thus familiar with this trade-off and are therefore able to make the best design decisions corresponding to the application they are building</strong>. So, folks, be aware of this trade-off, and <strong>think about what you really want from your application before you configure your DBMS</strong>.</p>
<img loading="lazy" decoding="async" src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fdatabase-replication-101%2F&amp;action_name=Database%20replication%20101&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>OVHcloud&#8217;s internal databases infrastructure</title>
		<link>https://blog.ovhcloud.com/ovhclouds-internal-databases-infrastructure/</link>
		
		<dc:creator><![CDATA[Wilfried Roset]]></dc:creator>
		<pubDate>Wed, 30 Oct 2019 16:08:13 +0000</pubDate>
				<category><![CDATA[OVHcloud Engineering]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<guid isPermaLink="false">https://www.ovh.com/blog/?p=16127</guid>

					<description><![CDATA[Today, most applications rely directly or indirectly on databases. I would even take a bet and say that a large portion of those are relational databases. At OVHcloud, we rely on several dozens of clusters hosting hundreds of databases to power thousands of applications. Most of those databases power our API, host billing information and [&#8230;]<img src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fovhclouds-internal-databases-infrastructure%2F&amp;action_name=OVHcloud%26%238217%3Bs%20internal%20databases%20infrastructure&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></description>
										<content:encoded><![CDATA[
<p>Today, most applications rely directly or indirectly on databases. I would even take a bet and say that a large portion of those are relational databases. At OVHcloud, we rely on several dozens of clusters hosting hundreds of databases to power thousands of applications. Most of those databases power our API, host billing information and customer details. </p>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" decoding="async" width="1024" height="538" src="https://www.ovh.com/blog/wp-content/uploads/2019/10/9152D129-C5F3-474B-A90E-9783A57B6331-1024x538.jpeg" alt="Internal database architecture" class="wp-image-16182" srcset="https://blog.ovhcloud.com/wp-content/uploads/2019/10/9152D129-C5F3-474B-A90E-9783A57B6331-1024x538.jpeg 1024w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/9152D129-C5F3-474B-A90E-9783A57B6331-300x158.jpeg 300w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/9152D129-C5F3-474B-A90E-9783A57B6331-768x404.jpeg 768w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/9152D129-C5F3-474B-A90E-9783A57B6331.jpeg 1200w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure></div>



<p>As part of the team responsible for this infrastructure, I can say it is a huge responsibility to maintain such a critical part of the beating heart of OVHcloud.</p>



<p>In this new series of blog posts we will take a closer look at OVHcloud internal relational databases infrastructure. This first post is about the infrastructure of the internal databases. At OVHcloud, we use 3 majors DBMS (database management systems), PostgreSQL MariaDB and MySQL, every one of them relying on the same cluster architecture.</p>



<p>But first, what exactly is a cluster? A cluster is a group of nodes (physical or virtual) working together to provide a SQL service.&nbsp;</p>



<p>At OVHcloud we have an open source and &#8220;do it yourself&#8221; culture. It allow us to control our costs and more importantly to master the technologies we rely on.</p>



<p>That&#8217;s why during the last 2 years we designed, deployed, improved and ran failure-proof cluster topologies, then industrialised them. To satisfy our reliability, performance and functional requirements, we decided on a common topology for all these clusters. Let&#8217;s find out what it looks like!</p>



<p>Each cluster is composed of 3 nodes, with each node its role &#8211; primary, replica and backup.</p>



<p>The primary node assumes read-write workloads, while the replica(s) only handle read-only queries. When the primary node fails, we promote a replica node to become the primary node. Because in the vast majority of cases, databases handle much more read-only than read-write queries, replica nodes can be added to scale the cluster&#8217;s read-only capabilities. This is called horizontal scaling. Our last node is dedicated to backup operations. Backups are incredibly important we will talk a bit more about them later.</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1024" height="649" src="https://www.ovh.com/blog/wp-content/uploads/2019/10/9FF40C14-B612-4089-8BA0-DA65E3DB8DEC-1024x649.jpeg" alt="Internal database cluster architecture" class="wp-image-16179" srcset="https://blog.ovhcloud.com/wp-content/uploads/2019/10/9FF40C14-B612-4089-8BA0-DA65E3DB8DEC-1024x649.jpeg 1024w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/9FF40C14-B612-4089-8BA0-DA65E3DB8DEC-300x190.jpeg 300w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/9FF40C14-B612-4089-8BA0-DA65E3DB8DEC-768x486.jpeg 768w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/9FF40C14-B612-4089-8BA0-DA65E3DB8DEC.jpeg 1473w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>Because every node in the cluster can be promoted to primary, they need to be able to handle the same workload. Thus, they must have exactly the same resources (CPU, RAM, disk, network &#8230;). This is particularly important when we need to promote a replica because it will have to handle the same workload. In this case, having primary and replica not equally sized can be disastrous for your workload. With our clusters up and running we can start querying them. Each cluster can host one or more databases depending on several factor such as infrastructure cost and workload types (business critical or not, transactional or analytic&#8230;).</p>



<p>Thus, a single cluster can host from only one big database to tens of smaller ones. In this context, small and big are not only defined by the  quantity of data but also by the expected frequency of queries. For this reason, we carefully tailor each cluster to provision them accordingly.  When a database grows and the cluster is no longer appropriately sized, we migrate the database to a new cluster.</p>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" decoding="async" width="1024" height="534" src="https://www.ovh.com/blog/wp-content/uploads/2019/10/database_dashboards-1024x534.png" alt="Internal database monitoring" class="wp-image-16174" srcset="https://blog.ovhcloud.com/wp-content/uploads/2019/10/database_dashboards-1024x534.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/database_dashboards-300x157.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/database_dashboards-768x401.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/database_dashboards.png 1828w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure></div>



<p>Aside from production we have another smaller environment that fulfils two needs. This is our development environment. We use it to test our backups and to provide our developers with a testing environment. We will get back to this matter in just a few lines.</p>



<p>Now let us talk about backups. As I mentioned earlier, backups are a critical part of enterprise-grade databases. To avoid having to maintain  different processes for different DBMS flavors, we designed a generic backup process that we apply to all of those.</p>



<p>This allowed us to automate it more efficiently and abstract the complexity behind different software.</p>



<p>As you have probably guessed by now, backups are performed by the backup node. This node is part of the cluster and data is synchronously replicated on it, but it does not receive any query. When a  snapshot is performed, the DBMS process is stopped and a snapshot of the filesystem is taken and sent to a storage server outside of the cluster for archival and resiliency. We use ZFS for this purpose because of its robustness and because of the incremental bandwidth which reduces the storage costs associated with snapshot archival.</p>



<p>But the main reason for having a separate backup node is the following: the cluster is not affected in any way by the backup. Indeed, backing up a full database can have a very visible impact on production (locks, CPU and  RAM consumption etc&#8230;), and we don&#8217;t want that on production nodes.</p>



<p>But  backups are useless if they can&#8217;t be restored. Therefore, every day, we restore the last snapshot of each cluster on a separate, dedicated node. This allows us to kill two birds with one stone, as this freshly restored backup is also used by our developers team to have an almost up-to-date development environment in addition to making sure we are able to restore backups.</p>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" decoding="async" width="1024" height="815" src="https://www.ovh.com/blog/wp-content/uploads/2019/10/F2546DE5-EF01-4942-9AA9-4374A8425301-1024x815.jpeg" alt="Internal database cluster backup and Dev use" class="wp-image-16180" srcset="https://blog.ovhcloud.com/wp-content/uploads/2019/10/F2546DE5-EF01-4942-9AA9-4374A8425301-1024x815.jpeg 1024w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/F2546DE5-EF01-4942-9AA9-4374A8425301-300x239.jpeg 300w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/F2546DE5-EF01-4942-9AA9-4374A8425301-768x611.jpeg 768w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/F2546DE5-EF01-4942-9AA9-4374A8425301.jpeg 1480w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure></div>



<p>To  summarise: our database clusters are modular but follow a common topology. Clusters can host a variable number of databases depending on their expected workloads. Each of these databases scale horizontally for read-only operations by proposing different connections for read-only and read-writes operations. Furthermore, backup nodes are used to having regular backups without impacting the production databases. Internally, these backups are then restored on separate nodes as a fresh development environment.</p>



<p>This completes our tour of OVHcloud&#8217;s Internal Database Infrastructure and you are now all set for the next post which will be about replication. Stay tuned!</p>
<img loading="lazy" decoding="async" src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fovhclouds-internal-databases-infrastructure%2F&amp;action_name=OVHcloud%26%238217%3Bs%20internal%20databases%20infrastructure&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
