Today's Reads

Engineering insights from across the web

Tiered storage: use the right tool for the job

Source: ./techtipsy | Published: 2023-03-26

ZFS L2ARC cache optimization, OpenZFS SLOG usage, homelab SSD tiering strategy, database performance on HDD arrays

Hard drives are still the default choice for many homelab and data hoarding enthusiasts. They still hold the gigabytes per dollar advantage over SSD-s (for now), and if you buy the big external drives and take the drives out of the enclosures, you can get a pretty good deal.

Spinning rust has one obvious downside: it’s slow, both in maximum transfer speeds and in latency. For most use cases this is fine, but if you run a service that depends on a database or if you have a lot of clients relying on that storage, you’ll find that hard drives just won’t cut it.

At this point you probably don’t want to splurge and build an all-SSD NAS, so you look up caching solutions. Depending on your platform, you’ll have all sorts of options.

If you run ZFS, you’ll likely learn about L2ARC and why you probably don’t want to use it (hint: check your ZFS ARC hit/miss ratio first). Or SLOG, or the special metadata device. And in most cases the top recommendation is to add as much RAM as you can to the system so that you can benefit from a bigger filesystem cache. You’ll see some improvements, but not all workloads will benefit from this and you might up being disappointed after all that work.

I cannot speak for options on other platforms, but in most cases the idea is similar: buy a separate sacrificial SSD and use it as a cache drive.

Cache is (not) king

Take a moment and think about what type of data you’re storing.

Here’s an overview based on my own setup:

  • archived YouTube videos (bunch of big files)
  • cat pictures (bunch of small and big files)
  • services that utilize a database (bunch of smaller files)
  • various installation media (bunch of big files)
  • backups of physical disks (bunch of big files)
  • a copy of my Steam library (bunch of big and small files)
  • a web server (bunch of small files)

Most of the data I have is accessed relatively infrequently, and when it is, the performance requirements are not that high. Any hard drive based array will be able to handle streaming video or copying big bulky files over the network.

Data that is more latency sensitive, such as Nextcloud, Jellyfin (and its .sqlite DB) and PostgreSQL, take up a relatively small part of the overall storage.

In this case (and assuming that the setup allows for it physically), the solution is simple: add a smaller flash-based storage pool to the setup and use it for data that benefits from it.

I experimented with a similar setup in the past with two 8 TB hard drives holding all the big files and a pair of 250 GB SSD-s handling Nextcloud and other services. Now I had the best of both worlds.

In short, you don’t need to mess around with a fancy caching solution if your storage usage patterns are simple and predictable. If you do a little bit of investigation once, you can bypass all the logic that is usually built into various caching solutions and get a better end result as no caching solution is 100% perfect.

Originally published on ./techtipsy

Read also

Why don’t we build simpler things?

By spqr

Source: The Craft of Coding | Published: 2022-09-06

software usability, feature creep, system design complexity, sustainable hardware engineering

There likely was a time when things in our everyday lives were simpler. As technology became more complex, so too did software. It is hard to know where exactly the problem lies. Of course the world as a whole has gotten more complex over the past 50 years, and some would argue that the choice of more complex solutions to things has not made out lives easier, in fact likely the complete opposite.

“Any intelligent fool can make things bigger, more complex and more violent. It takes a touch of genius – and a lot of courage – to move in the opposite direction.”

E.F. Schumacker

A good example are home appliances. Most now contain software of one sort or another, coupled together with logic boards to make things operate. Some even hook up to wi-fi. The problem is no-one needs this level of complexity in a machine designed to wash clothes. I’m sure the electronics inside provide something in the way of efficiency, but the products themselves often seem to be designed by people with little or no clue about what the devices are used for. Washing machines for example do not need 1001 programs – they need maybe a few more than provided on laundromat machines. These machines also don’t need things like “steam-clean”, or any fancy programs to get stains out. You know what gets stains out? A Marseille Laundry Cube, and it lasts years. Don’t rely on a machine to do something you can achieve in a couple of minutes. So a washing machine likely needs maybe 10-12 different cycles for different items, a couple of spin speeds, and some water temperature choices. Oh, and a simple 5 minute rinse and spin cycle. I have a Miele washing machine, and it seems to be extremely well designed, although I don’t need the wi-fi, and it still probably has too many cycles (thankfully many are hidden from view in the touch-screen menu). One thing I do like is that it has a maintenance “cleaning” cycle which cleans the machine, and it prompts me when it has to be done.

Dishwashers are the same… too many options. On my Miele dishwasher I basically only use the normal cycle, and perhaps the “pots and pans” cycle when I’m running it through a clean cycle. Still the cycles seem *way* too long. But it is simple, and that’s what makes it a well designed machine. Microwaves also suffer from feature overload – my Breville does a great job, but in reality I probably use about 10 functions including reheating drinks and leftovers, softening butter, and melting chocolate. Most things I don’t really need. Function inflation, or “setting creep” is everywhere. Things that we use should do what they are designed for and no more.

“Increasingly, people seem to misinterpret complexity as sophistication, which is baffling. The incomprehensible should cause suspicion rather than admiration.”

Niklaus Wirth

Sometimes it really is like people think that complexity is a good thing. That making things more complicated with entice people to buy them. Oh, of course we know that is true, because humans are quite fickle. Was stuff really made better in the past, when things were simpler? In actuality, although refrigerators have become more efficient, they don’t last as long, and arguably they are as well designed inside. Check out this video below which is a fridge ad from 66 years ago. The features in this fridge actually seem extremely well designed… without the need for 1001 pieces of fancy technology.

If we actually looked at things a little closer, and maybe examined historical design we might be able to build things that are simpler, last longer and are actually better from a usability perspective. It’s the same with software – I imagine much of it is too complex and poorly designed from a usability perspective. Complexity doesn’t make sense from an sustainability perspective either. Complex things break more, and often don’t last as long.

Originally published on The Craft of Coding

Read also

Things that

By Will Larson

Source: Irrational Exuberance | Published: 2026-03-29

engineering strategy, VSMO framework, organizational alignment, technical leadership, team operational strategy

This is pruned from Engineering strategy.

When you’re writing an engineering strategy, what you put in is important, but it’s almost as important to be deliberate about what you choose to leave out. The full list of things to exclude is uncountably vast, but there are a few worth emphasizing in particular.

LinkedIn’s Jeff Weiner documented their hierarchy of operating documents as Vision, Mission, Strategy, Objectives, Priorities, Culture, and Values (which some companies have standardized as VSMO). Some of those are very helpful, but two to leave out when writing an engineering strategy are “culture” and “values.” These are quite important, but must be handled at the company scope rather than the engineering scope. Organizations within a company that go too far in shaping values distinct from the company values inevitably create a Values Oasis: a short-term workaround that requires more and more maintenance energy from your organizational leadership until eventually they have little time for anything else. If you want to define engineering specific values, channel that energy towards aligning with the broader company’s values instead.

A third VSMO idea that I’ve excluded is “mission.” I’ve almost universally found that team and organizational mission statements create more confusion and misalignment than they resolve. Mission statements are an attempt to rewrite reality with force of desire, which is, I’m sad to say, folly. Mission statements are treated as statements of truth about what a team ought to be doing, but this is a fundamentally misunderstanding of why teams exist: they exist to support the business, and in the case of engineering teams, they generally do so by supporting other teams. A team’s purpose depends much more heavily on what their users need than on what they want to be working on.

Further, mission statements fall afoul of both the “don’t generalize” and “don’t lie” rules of effective engineering strategy. Most mission statements create confusion by articulating the team’s desired state rather than their actual state. They also tend to be overly broad in a way that causes incompatible interpretations. Finally, they tend to overstep to “claim territory” from other related teams, wasting energy on folks competing to “own” areas that neither team is capable of actually supporting. Rather than a team mission, write a team strategy explaining your guiding policies to navigate your current circumstances.

Finally, abandon your plan to proclaim axiomatic truths. It’s extremely tempting to start out your engineering strategy by writing a series of bold statements about reality—Simple code is good code! Optimize for discounted future developer velocity!—but lists of commandments are dead documents on arrival that cannot evolve with your organization as you grow. Instead of writing axioms, write a strategy explaining why these are important and fold it into your quality measure. That will create a living document that folks can evolve with you and lives beyond your tenure.

Originally published on Irrational Exuberance

Read also

Siemens SAB80199: 16-bits for Europe

By CPU Shack Museum

Source: The CPU Shack Museum | Published: 2026-03-29

Siemens SAB80199 processor, 16-bit microprocessor architecture, real-time operating system hardware, 1980s semiconductor technology, instruction cache implementation

January 1st, 2016 ~ by admin

Siemens SAB80199 - Introduced 1983 @ 20MHz This example is made in 1985

Siemens SAB80199 – Introduced 1983 @ 20MHz This example is made in 1985

By 1982 Siemens has firmly established themselves as a semiconductor powerhouse in West Germany, and the entirely of western Europe.  Their manufacturing prowess led them to be Intel’s second source of choice in Europe, building 8008,8080, and 8086/8 processors, with production beginning for the 186 and 286s processors as well.  Siemens’ expertise was not just in making second sourcing others work, they had their own design/development as well, doing a large amount of work for the industrial automation market as well as others.

In late 1982 they announced a new 16-bit processor, one of their own design.  Production began in 1983 and continued for over a decade.  The 80199 had a 8086 compatible bus, but that’s where the similarities end.  The 80199 is often described as a ‘Terminal COntrol Processor’ or a ‘Printer Controller’ which is a bit deceptive.  It was designed  from the outset as a real time processor, capable of handling multiple real time tasks.

Siemens SAB80199 made in 1990, and still marked 'W. GERMANY'

Siemens SAB80199 made in 1990, and still marked ‘W. GERMANY’

The SAB80199 was built on a 3 micron NMOS process and contains 40,000 transistors on a 45mm2 die.  Clock speed is 20 MHz (faster then most anything else in 1983) and had an instruction cycle of 0.5 microseconds.  It moved many of the RTOS functions from software (or an external chip like Intel’s 80130 RTOS co-processor for the 808x) to on chip hardware.  It had 8 status registers, 8 instruction pointers, and 8 sets of registers.  This allowed very rapid task switching as each tasks data did not have to be saved/restored, a complete task switch took 1 microsecond to complete.  In addition the 80199 had another feature that was rather novel at the time, cache.  The processor contained an on chip instruction cache the could hold 16, 16-bit instructions.  For some sets of code, such as a simple loop, the entirely of the instructions for it, would reside on chip, resulting in very fast execution.  Today of course caches for data/instructions are normal, and very large, measured in KB and MB but in 1983 it was virtually unknown.

In 1983 the ‘West Europe Report’ called Siemens 80199 the ‘Fast Bavarian’, fast indeed, and it was adopted across Europe, but never made it to the American market in any quantity.  It is perhaps one of the ‘forgottens’ but certainly deserves a place in the history of real time computing.

Originally published on The CPU Shack Museum

Read also

Hadamard's inequality, upper bound on determinant

By John D. Cook

Source: John D. Cook | Published: 2020-07-22

Hadamard inequality, NumPy matrix determinant, SciPy statistical simulation, Linear algebra error analysis

For an n by n real matrix A, Hadamard’s upper bound on determinant is

 |A|^2 \leq \prod_{i=1}^n \sum_{j=1}^n a_{ij}^2

where aij is the element in row i and column j. See, for example, [1].

How tight is this upper bound? To find out, let’s write a little Python code to generate random matrices and compare their determinants to Hadamard’s bounds. We’ll take the square root of both sides of Hadamard’s inequality to get an upper bound on the absolute value of the determinant.

Hadamard’s inequality is homogeneous: multiplying the matrix A by λ multiplies both sides by λn. We’ll look at the ratio of Hadamard’s bound to the exact determinant. This has the same effect as generating matrices to have a fixed determinant value, such as 1.

    
    from scipy.stats import norm
    from scipy.linalg import det
    import matplotlib.pyplot as plt
    import numpy as np
    
    # Hadamard's upper bound on determinant squared
    def hadamard(A):
        return np.prod(np.sum(A**2, axis=1))
                
    N = 1000
    ratios = np.empty(N)
    
    dim = 3
    for i in range(N):
        A = norm.rvs(size=(dim, dim))
        ratios[i] = hadamard(A)**0.5/abs(det(A))
    
    plt.hist(ratios, bins=int(N**0.5))
    plt.show()
    

In this simulation the ratio is very often around 25 or less, but occasionally much larger, 730 in this example.

histogram

It makes sense that the ratio could be large; in theory the ratio could be infinite because the determinant could be zero. The error is frequently much smaller than the histogram might imply since a lot of small values are binned together.

I modified the code above to print quantiles and ran it again.

    print(min(ratios), max(ratios))
    qs = [0.05, 0.25, 0.5, 0.75, 0.95]
    print( [np.quantile(ratios, q) for q in qs] )

This printed

    1.0022 1624.9836
    [1.1558, 1.6450, 2.6048, 5.7189, 32.49279]

So while the maximum ratio was 1624, the ratio was less than 2.6048 half the time, and less than 5.7189 three quarters of the time.

Hadamard’s upper bound can be very inaccurate; there’s no limit on the relative error, though you could bound the absolute error in terms of the norm of the matrix. However, very often the relative error is moderately small.

More posts on determinants

[1] Courant and Hilbert, Methods of Mathematical Physics, Volume 1.

Originally published on John D. Cook

Read also

Discover more by topic.