EVE Cache Monitor (ECM)

I’ve been playing EVE for over four years now and if there’s one thing I can definitely say about CCP is that they have one thing in common with most other MMO’s.  Rather than concern themselves with making a bug-free, stable piece of software, they spend millions on introducing new features, loaded with new bugs.  And, instead of fixing broken code, they busy themselves with shiny new graphics  (yes, I suppose even art majors need a reason to live.)

One bug that has existed in EVE for YEARS now is the mess made by the MachoNet cache.  CCP tries to reduce the load on their servers by stashing little bits of information on your hard drive.  That, in itself is a good idea.  But, good ideas taken too far become bad ideas.

So here’s my story…

Recently I upgraded my trade skills to tycoon level.  Previously, I had been running about 30 odd trades pretty consistently.  Now, I’m running 200+ and tend to check them on a daily basis at least once.  Furthermore, I run two clients.  My alt, as a part of his business, tends to study the standings of other players quite often.  Combine those two factors and, little did I know, aggravation was lurking around the corner.

Slowly and agonizingly over a several week period, my clients became clunkier and slower.  Loading up the market became a test of my patience, and god forbid you should try to look up a player’s standings while warping.  My clients would freeze, lock up and sputter like an antique John Deere tractor.

I was convinced that this was CCP’s famous MSSQL database lagging it’s brains out with 50,000+ people banging on it.  I was wrong.  It was CCP’s inability to write code that was causing this.

As it turns out, I got to digging in the MachoNet cache and found 9,100+ little .cache files all stuffed in the directory. Now I have a decent machine (for the moment), a quad core Black Phenom with a really fast Samsung hard drive and 4 gigs of gaming ram.  Even VAST amount of crap like that shouldn’t have turned my new machine into a C-64.  No, CCP’s coding did.  Every single time you, for example, open up a character’s status sheet and look at their standings, it downloads and caches a little file along with the image of the agent.  I’ve seen some players with 30-40 agents.  Now just imagine the EVE client having to look through 9,000 odd cache files to see if you’ve looked at someone else who uses that agent just to see if it’s already got the information before downloading it.  Multiply that by the number of agents a character has on his standings sheet, then magnify that by the fact that every single time you look at a character this process gets even LONGER because more cache files are added….  It’s exponential.

I performed a test.  I took every single cache file and moved it to a backup directory, while the client was running. Care to guess the results?

Pulling up items in the market, the response was almost instantaneous.  It would download the information from the server and cache it.  Took half a second.  If you went back to that same item in the market, instantaneous as it pulled it from the cache.  The same with player information.  My clients began running so smoothly that I was actually impressed with them again.  NO LAG… I was happy.

But, that was only a temporary fix.  The next day, there were over 2,000 .cache files back in the directory and I could see the performance dragging yet again.

So, what I was seeing was a BORKED cache system that appeared to expire the cache files based how long that file had been on the drive and didn’t bother to consider how MANY cache files were in the directory.  Rather than come up with a viable, working cache, which they should have done years ago, CCP placed this really cool button on the client. If you hit ‘ESC’ you’ll see a tab that says…. get this… RESET SETTINGS/Clear all cache files.  I know, that’s Icelandic computer geek so I’ll translate, “We haven’t figured out how to make our clients cache run properly, so when it does get BORKED, just clicky here.”  Unfortunately, it requires that you restart your client every time you do it.

Enter EVE Cache Monitor, stage left.

Time for a working solution. I sat down and began writing a little program that would sit in my task bar. It had one sole purpose in life.  To monitor that cache directory and keep the number of files in it perpetually the same, deleting the oldest files first.

Here’s how it works. (I’ve added a configuration to it so this is what happens when it’s already running.)  Windows issues what’s called an API call ever time a file is created, deleted, modified, etc…  EVE Cache Monitor (ECM note the sarcasm), fires up and loads up a list of all the known .cache files in that directory.  It then watches the cache directory for those API calls. Every time a new .cache file is created, it loads it into the top of a list and sorts them by file age.  It then delete’s the oldest file on the list.  Pretty simple logic eh?  Here’s the best part, you won’t even notice it running (unless you really are on a C-64).  It’s memory usage is tiny and it uses no processor cycles until the API call is fired off when the new .cache file is created.

So far, I’ve seen nothing but improved performance when running 2 clients.  Furthermore, the EVE client doesn’t even seem to notice those cache files are vanishing.  I’ve actually set it to delete every file in that directory the moment they’re created and the EVE clients still keep running and I don’t see any screwy data.  Having played with it a bit, I am convinced that the cache does improve the client performance WHEN you look at an item a second time.  For example, you look at AB1′s on the market, then look at AB10′s and want to go back and look at the AB1′s again… the cache works as intended.  It pulls up the AB1′s instantly from the cache rather than downloading the market info from the server.  So, again, a few cooks in the kitchen are a good thing.

So, what I’ve done is to program ECM so that it will attempt to automatically find this bad, bad cache directory (which just happens to be in a Windows hidden directory these days), and will allow you to configure how many cache files you want it to maintain.  Once configured, it drops down to the task bar and silently monitors your cache directory.  The next time you start it, it loads it’s configuration (from a file called ECM.ini) and silently goes to work.

So far it seems to work as intended and my clients run smooth.  THEREFORE, until CCP decides to come up with a coding solution that a hillbilly originally from Kentucky seems to have figured out, I hereby release ECM as freeware.

Please visit the download page and enjoy.

One Response to EVE Cache Monitor (ECM)

  1. Pingback: Twisted Void Tools | SCC Lounge

Leave a Reply