I/O Writes and KoLmafia

Ima Felyn

Member
Is there a way to stop any and all logging from happening with KoLmafia? In the preference menu I see the extra debugging stuff that I have all that stuff unchecked, but it still logs a ton of stuff, and I can't be the only one who has never looked at any of it, ever, in all my years of using this fine app. Maybe I'm just missing the way to achieve this or it's a hidden command line or something I don't know of, but I thought I would ask. Maybe make this a feature request if there isn't a way?
 

fronobulax

Developer
Staff member
Are you referring to the session logs or something else?

If the session logs, is there a specific reason? Perhaps you run from a solid state memory device or you would rather not delete files you believe you will never need?

There are many players who use the session logs to fine tune their play strategies and there are many bugs that have been found faster because the session log was already available so the logs have value to a portion of the community.

Before I implemented a FR I would experiment and see whether assigning STDOUT (and others) to dev/null was respected and had the desired effect.
 

lostcalpolydude

Developer
Staff member
Given "I/O Writes" in the title, I'm guessing it's disk activity they want to prevent rather than having the files sitting around long term.
 

Ima Felyn

Member
Mainly it's for long term health reasons of solid state memory devices, yes I know it'll take billions and trillions of writes to kill an SSD but this thing really adds up over time, running Mafia just once automating everything causes around 180,000 I/O writes, I have 5 accounts so this is about a million each day, much more then my entire system does in 24 hours of being on. I'm not saying to remove session logging and other logging's Mafia does, only a way to disable it for people like me. I know logging is helpful for others for debugging purposes, and for min/maxers who use them to min/max their runs, but I've never once looked at them personally and probably wont unless there was a problem I needed to debug, but then I could just turn them on for that problem until solved, and honestly I wouldn't even really know how to make sense of all that data if I did start looking at them and I'm just thinking long term health of SSD's and such. It would also be great as I wouldn't have to keep manually deleting all those session logs every now and then.
 

xKiv

Active member
causes around 180,000 I/O writes, I have 5 accounts so this is about a million each day,

As reported by the OS, or the disk itself (in SMART)? Because there should be enough buffering/caching before the hardware itself to mitigate most of that ...


BTW, I just picked a "random" large session log from my archive (a 750 KB one), and it has only 18K lines. And somehow I don't think mafia is doing more than one I/O per line ... that's the most basic buffering there is, and it's generally included by default when you write text files in high-level languages ...


ETA: also, are you sure that the 180K figure doesn't include network activity?
 
Last edited:

Ima Felyn

Member
Reported by the OS, and to correct my numbers from before because after checking two more times, there were 20,000,000 I/O writes on first run for that day, I guess because it scans the mall for prices, and then ~500,000 I/O writes each run after that. I'm not sure where I got that 200,000 numbers from before because that wasn't even close to what was showing now. I really hope this can become a feature to disable session logging because I think that where it all comes from, or maybe just redirect into a ramdisk (less write on SSD and potentially faster I/O).
 

lostcalpolydude

Developer
Staff member
I would suggest disabling Preferences -> General -> Save options to disk whenever they change. You don't really want charactername_prefs.txt to go away, but you probably only want the file to be updated when you close mafia.
 

xKiv

Active member
I would suggest trusting that the ssd has a transparent cache and doesn't write a block 100 times if there are 100 writes to the block in 30 seconds.
And also check SMART info to see how many writes the disk actually physically does write. Assuming that you can get this information out of your disk's SMART. I can't.
Also, any large modern ssd should be able to take an uninterrupted stream of writes at max speed for at least a year, and you are nowhere near that level. You will probably buy a new one (because this one will be too small) long before this one runs out of writes.
 

Ima Felyn

Member
I would suggest disabling Preferences -> General -> Save options to disk whenever they change. You don't really want charactername_prefs.txt to go away, but you probably only want the file to be updated when you close mafia.

Good idea, I must have passed over this option when I looked for ways to lesson the I/O writes before. I'll try this out but I don't think this will make much of a dent.

I would suggest trusting that the ssd has a transparent cache and doesn't write a block 100 times if there are 100 writes to the block in 30 seconds.
And also check SMART info to see how many writes the disk actually physically does write. Assuming that you can get this information out of your disk's SMART. I can't.
Also, any large modern ssd should be able to take an uninterrupted stream of writes at max speed for at least a year, and you are nowhere near that level. You will probably buy a new one (because this one will be too small) long before this one runs out of writes.

I'm unable to check SMART data either, it was one of the earliest SSD's on the market from when I build my PC twoish years ago so it lacks that ability.
 
Top