How to configure $JENKINS_HOME/caches dir location?

2,077 views
Skip to first unread message

Calvin Park

unread,
Feb 2, 2019, 6:44:45 PM2/2/19
to Jenkins Users
I'm running $JENKINS_HOME on NFS. Due to the performance penalty, I want to move out as many temp directories as I can to local disk.

Thus far I've moved
  • -Djenkins.model.Jenkins.workspacesDir='/local_cache/workspace/${ITEM_FULL_NAME}'
  • --webroot=/local_cache/web
  • --pluginroot=/local_cache/plugin
In $JENKINS_HOME there's caches directory which seems like an obvious choice to move out.
  1. Is there a way to configure the location for $JENKINS_HOME/caches?
  2. What are other directories that can be recreated, thus can be moved out of the NFS?
Thanks!

Baptiste Mathus

unread,
Feb 5, 2019, 9:08:46 AM2/5/19
to jenkins...@googlegroups.com
I've had a quick look, and I'm not sure I ever saw a caches directory under JENKINS_HOME (this is very possible I just don't remember).
Can you possibly list what's in there so we can try and understand what is generating this directory?

We segregate data quite aggressively already in Evergreen and I do not remember of such a directory/option.

Thanks

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/6a923fd6-da83-484e-b57c-c899e08a56f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Victor Martinez

unread,
Feb 5, 2019, 12:06:19 PM2/5/19
to Jenkins Users
https://issues.jenkins-ci.org/browse/JENKINS-18578 provides some details about fixing the 'cache' folder, is that what you need?

Calvin Park

unread,
Feb 8, 2019, 6:52:08 PM2/8/19
to Jenkins Users
It seems to contain some sort of git cache. Thankfully(?) all the directories are empty.
/mnt/nfs/jenkins_home$ ls caches/
git-0d341dcbcc7c33c4efc44a104b892b60      git-79660c3529cacbdbe1ac71b7c36e1a3f
git-0d341dcbcc7c33c4efc44a104b892b60@tmp  git-79660c3529cacbdbe1ac71b7c36e1a3f@tmp
git-0fba0b0ccfb8c3ca2809f860ea497fbf      git-84f1d58c7f2dde1b560bd3471e85cf5f
git-0fba0b0ccfb8c3ca2809f860ea497fbf@tmp  git-84f1d58c7f2dde1b560bd3471e85cf5f@tmp
git-117076ea5a481ebdd2beea321164041c      git-93d0b594de0d6af9e1ac33ea8dd03742
git-117076ea5a481ebdd2beea321164041c@tmp  git-93d0b594de0d6af9e1ac33ea8dd03742@tmp
git-20faeeea626404c43e0af02b3443a0ca      git-bedd02d2756f33f2b6dd8e496041e9a5
git-20faeeea626404c43e0af02b3443a0ca@tmp  git-bedd02d2756f33f2b6dd8e496041e9a5@tmp
git-6637777a4358cb957136aec86030ea76      git-ca5af9d29c97e0a07af654ef31dbcd93
git-6637777a4358cb957136aec86030ea76@tmp  git-cde48c33a9866d69b3dab200ae527b91
git-6c18e173e843c139db9b4bcd2949c277      git-cde48c33a9866d69b3dab200ae527b91@tmp
git-6c18e173e843c139db9b4bcd2949c277@tmp  git-ea66c44ab8389abea26eb7f2f93ee8d0
git-72cee31ae083a2db1f8fb009bcf624ed      git-ea66c44ab8389abea26eb7f2f93ee8d0@tmp
git-72cee31ae083a2db1f8fb009bcf624ed@tmp


In order to minimize the performance hit from putting jenkins_home on NFS, I'm trying to find the directories which are frequently accessed directories and has many small files
/mnt/nfs/jenkins_home$ ls -d */
.cache/          ?
.groovy/         ?
.java/           ?
caches/          ?
config-history/
fingerprints/
init.groovy.d/
jobs/
     builds/     moved out to local disk and not backed up
     workspace/  moved out to local disk and not backed up
logs/
nodes/
plugins/   moved out to local disk and not backed up
secrets/
updates/
userContent/
users/
war/   moved out to local disk and not backed up
workflow-libs/

What are some of the other directories in here that I can/should move out of NFS? Ideally they should be ephemeral and frequently accessed.

Thank you

Calvin Park

unread,
Feb 8, 2019, 6:53:17 PM2/8/19
to Jenkins Users
This looks useful but I can't follow the thread. What was the change that was made at the end?

Mark Waite

unread,
Feb 8, 2019, 6:58:20 PM2/8/19
to Jenkins Users
Used by multibranch pipeline and possibly by pipeline as far as I recall. 

Baptiste Mathus

unread,
Feb 10, 2019, 8:01:53 AM2/10/19
to jenkins...@googlegroups.com
Interesting.

If confirmed, I think it would make sense that Jenkins Core offers a simple API for providing some kind of root directory for storing caches, that plugins would then follow so user don't have to go and configure each plugin's cache dir outside of some NFS or backed up root directory.

Also, it would allow likely Jenkins to create a CACHEDIR.TAG file at that root to instruct backup tools about the intent of that dir.

Reply all
Reply to author
Forward
0 new messages