A networked in-memory cache written with Boost.Beast in C++ for CSCI 389 (Computer Systems) at Reed College.
The architecture is approximated by the following diagram:
Install the dependencies:
pacman -S boost.
pacman -S catch2. You can also download the amalgamated header and include it manually. See the tutorial for details.
make to build everything. You should see 3 executables:
cache_serveris the cache itself. Run with
-hto see the options. By default it listens on localhost:42069 and has a maximum allowable cache size of about 64K. The
-toption to specify the number of threads won't do anything as we never got it working reliably.
test_cache_clientis a cache client that tests a running server using the Catch framework.
test_cache_storeis only tests the cache library defined in
cache.hhit also makes use of the Catch framework.
The architecture diagram makes reference to a
executable and lru_evictor header and source files, however we didn't
end up writing those. The only eviction policy currently implemented
is a FIFO evictor.
To test the server; in one terminal run
./cache_server, and in
To test the cache library itself, just run
Both test should print, in green:
All tests passed. If not then
you're either doing something wrong or Boost is being a pita again and
I feel your pain.