What is Run Folder in /application support/Local/ on Mac OS?

What issue or error are you experiencing? Noticed 41 GB of disk space used by the folder listed above, can these files be deleted? Or how can they be cleaned up on a regular basis?

System Details

  • Local Version: - 8.21

  • Operating System (OS) and OS version: - Mac OS Ventura


Hi @kkramer2195

41 GB is quite large!

Have you used Local for a while and/or have a lot of sites installed? There should be some stuff in there you can clean out but certain things will come back once you use Local to create or start sites again.

Hi Nick,

i have 27 sites, only activate them when I am going to do work on them, I do use WP Migrate to sync sites with them at times, so not sure if it is tied to that or not.

The folder names are random letters/numbers so i can’t say which is tied to which, but in looking at some of the files in one folder, it has a lot of files named binlog.000xxx, where xxx is numbers

The binlog files are over 1gb in size in the MySQL/Data folder

I have been using Local for about 1.5 years now…

For something more immediate, if you have any sites you’re not currently working on but just want to save you could export those sites to save as zips, and then delete them from Local. Or you could use something like our Cloud Backups feature as well: Cloud Backups

I’m going to check with my team about other recommendations for clearing out bloat and optimizing simply because I don’t want to steer you in a direction that could remove something critical. If you do decide to do any tinkering with cleaning stuff as always it’s a good idea to save work and backup along the way :slight_smile:

Thanks Nick,

I can wait till you talk with your team…I will see if any sites can be removed (I am sure there are a couple)

Thanks again!

Ken

1 Like

@kkramer2195

The mysql folder is about 300 MB for each website in my run folder. How large these log and bin files should be can be preset in a mysql config file somewhere. I just can’t remember right now how I did this but I’ll try to find the documentation. So I have basically set mine so the three log and data files won’t be any larger than 100 MB. There is also difference in how MySQL 5.7 and 8.0 operates and the standard size of these files.

2 Likes

Here is my current my.cnf.hbs config file for mysql version 5.7.28. But there is a special process to change parameters to not crash or destroy the database. Please notice innodb_log_file_size = 96M

[mysqld]
{{#unless os.windows}}
skip-name-resolve
{{/unless}}

datadir = {{datadir}}
port = {{port}}
bind-address = {{bindAddress}}
socket = {{socket}}

{{#if os.windows}}
console
{{/if}}

# Fine Tuning
performance_schema = off
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 8

# InnoDB
innodb_buffer_pool_size = 32M
innodb_log_file_size = 96M

[client]
{{#unless os.windows}}
socket = {{socket}}
{{else}}
host = {{clientAddress}}
port = {{port}}
{{/unless}}
user = root
password = root

“If you want to know what the ib_logfile0 and ib_logfile1 are for, they are the InnoDB Redo Logs. They should never be erased or resized until a full normal shutdown of mysqld has taken place. If mysqld ever crashes, just start up mysqld. It will read across ib_logfile0 and ib_logfile1 to check for any data changes that were not posted to the the double write buffer in ibdata1. It will replay (redo) those changes. Once they are replayed and stored, mysqld becomes ready for new DB Connections.”

2 Likes

Thanks for the information, I just checked my largest file and I have the same settings for the InnoDB as you, so I wonder if that is now the default size from when you edited yours.

I do appreciate the information, i don’t mind learning more to improve my usage of Local!

Ken

I read somewhere that binary logs (binlog.00000X) may grow up to 1GB which is the default (max_binlog_size). My largest files are the InnoDB redo logs (ib_logfile0 and ib_logfile1) which are set by the innodb_log_file_size constant. But I don’t have any binlog.00000X files at all in my run folder? Where are your binary logs located? I’m running macOS and MySQL 5.7.28 for all my local websites. Try to search in the official MySQL reference manual for more info. I had a similar problem a year ago but can’t remember what I did.

1 Like

Hi @kkramer2195

I just wanted to circle back here and mention that I checked with the team on this. Officially our best and easiest recommendation is to just export/offload old sites that aren’t currently being worked on to save space. Deleting the Run folder could definitely be problematic, but if you’re comfortable with the notes from our friend @emmtre you can do some tinkering to try and see if you can get enough benefit from those recommendations.

Since I don’t have any binary logs in my run folder for any websites I spun up a test website with MySQL 8.0 and then lo and behold there are the binary logs. I then tried to edit the my.cnf.hbs config file in the mysql folder for the test website and add a value for max_binlog_size. But whatever I tried I couldn’t start the test website and I got an error message that the max_binlog_size is an unknown variable. So it didn’t work to try to decrease the size of the the binary logs. There are some other interesting variables like binlog_expire_logs_seconds. Please see the documentation for more info. It also looks like there is a purge statement.

> You can delete all binary log files with the RESET MASTER statement, or a subset of them with PURGE BINARY LOGS. See Section 15.7.8.6, “RESET Statement”, and Section 15.4.1.1, “PURGE BINARY LOGS Statement”.

https://dev.mysql.com/doc/refman/8.0/en/binary-log.html

https://dev.mysql.com/doc/refman/8.0/en/replication-options-binary-log.html#sysvar_max_binlog_size