AD7six.com

Keyboard, coffee and code.

File Caching - Preventing Running Out of Space

On one project I take care of it creates a large number of sizable files (which can be reproduced on demand). Each file take about a minute to create and are typically only accessed once. However, some files are more popular than others and once created are accessed repeatedly. In the early days of this project I had 1TB of space available, didn’t think about what could happen and left the project to run. Gradually all space was eaten up by the storing of these files eventually leading to the question:

How to efficiently store as many files as possible without running out of space?

If you’re familiar with linux commands the answer may be obvious, but if you’re not (or maybe even if you are and it’s pre-coffee time) this is what I’d like to document today.

Logrotate: Rotate Your Log Files

Every once in a while, I’ve found myself looking at a simple, stable, app deployed on a server that hasn’t been touched in months and being asked (or myself wondering) one of these things:

  • Why is it getting slower and slower?
  • How has this app managed to use all free space on the server?

A common and repeating cause for both problems is: fat log files. There’s a simple solution which is possibly often forgotten and that’s what I’d like to write about today.

CakePHP 3.x - Entity Routing

One of the most satisfying bits of code to write, are those simple solutions to simple (or overlooked) problems. The problem I’m going to write about today is Routing.

What’s wrong with routing?

Nothing.

However, that’s not to say it can’t be improved.

A Clean Slate

Let’s start again shall we.

Many moons ago, I would be eager to write, but there would always be something inbetween me and writing that got in the way. One of those things was looking at the collected tangle of code/projects that I’ve accumulated over the years, so today I’ve cleaned house, archived a load of my stale git projects on my git archive.

Another barrier to writing was simply looking at my obsolete posts - which were written mostly for/about CakePHP version 1. CakePHP version 3.0 is right around the corner to to open the way to dumping code and ideas about that I’ve archived my old posts leaving a freshly combed sandpit ready to be jumped into.

I’m hopeful over the next few months to get back into the habit of writing regularly, and publishing a few tutorials based on my experiences building applications with CakePHP 3.0.