Remote build cache node keeps evicting cache entries

Hi team,

We have recently set up gradle remote build cache node using Docker but having some issues with pushing the cache to the remote node

The config we have in setting.gradle is:

buildCache {
    remote(HttpBuildCache) {
        allowInsecureProtocol = true
        url = 'http://build-cache-node:5071/cache/'
        push = true
        enabled = true
        credentials {
            username = "xxxx"
            password = "xxxxx"
        }
    }
}

We are able to access the web UI and can see that only little storage is being utilised and cache entries are kept being evicted. Message displayed on the web UI The build cache is empty - 2 B disk space used, 9.7 GiB reserved for temp storage, 9.7 GiB free on disk.

Our cache node config:

version: 5
cache:
  accessControl:
    users:
      xxxx:
        level: readwrite
        password:  xx       
        note: ""
    anonymousLevel: none
  freeSpaceBufferSize: 3036
  maxEntryAgeInHours: null
  maxArtifactSize: 5012
  targetSize:
    type: maxAvailable
uiAccess:
  type: generated
registration: null

logs from the cache node:

2023-01-19 05:03:30,487 WARN c.g.e.r.f.c.a.j {eid=k3yc5j3fhatdg, service=MaintainSizeTask} Could not find evictable entry, aborting with current size of 2 
2023-01-19 05:03:30,487 INFO c.g.e.r.f.c.a.k {eid=jq53fw4o56nso, service=MonitorFileStoreStorageStateTask} Using target cache size of 6.7 GiB (requested free space buffer: 2.9 GiB, free space: Optional[9.7 GiB]) 
2023-01-19 05:03:35,487 WARN c.g.e.r.f.c.a.j {eid=av2s22e3bglms, service=MaintainSizeTask} Could not find evictable entry, aborting with current size of 2 
2023-01-19 05:03:40,487 WARN c.g.e.r.f.c.a.j {eid=trpjt6xbiicyo, service=MaintainSizeTask} Could not find evictable entry, aborting with current size of 2 
2023-01-19 05:03:45,487 WARN c.g.e.r.f.c.a.j {eid=froxxuzhysb36, service=MaintainSizeTask} Could not find evictable entry, aborting with current size of 2 
2023-01-19 05:03:47,110 INFO c.g.e.r.f.c.a {eid=hqmoiv6rumspm} Configured storage settings: target cache size = maximum available, overridden volume size = 10 GiB, free space buffer size = 2.9 GiB, incoming buffer entry size = 4.8 GiB 
2023-01-19 05:03:47,110 INFO c.g.e.r.f.c.a {eid=hqmoiv6rumspm} Configuration disabled age based eviction 
2023-01-19 05:23:10,638 WARN c.g.e.r.f.c.a.j {eid=yb5mizf2rfsso, service=MaintainSizeTask} Could not find evictable entry, aborting with current size of 2 
2023-01-19 05:23:15,638 WARN c.g.e.r.f.c.a.j {eid=inas2sasgei34, service=MaintainSizeTask} Could not find evictable entry, aborting with current size of 2 
2023-01-19 05:23:19,792 INFO c.g.e.r.f.a.a {eid=ceobowncoq5ui, service=MaintainLruTableTask} Took 0 ms to write the index file (39 bytes) to disk 
2023-01-19 05:23:20,639 WARN c.g.e.r.f.c.a.j {eid=t4627b433i3uw, service=MaintainSizeTask} Store is over target size but is empty 
2023-01-19 05:23:25,639 WARN c.g.e.r.f.c.a.j {eid=6imdxlvab4xr4, service=MaintainSizeTask} Could not find evictable entry, aborting with current size of 39 
2023-01-19 05:25:30,655 INFO c.g.e.r.f.c.a.j {eid=3rl52a7zuor2y, service=MaintainSizeTask} Effective target size changed from 7261835303 to 7261828706 during eviction 

Any suggestions?

I have no real experience with the remote build cache node.
But from the config and logs I would guess these facts:

  • you configured free space buffer size of 3,036 MiB = 2.96 GiB
  • you configured max artifact size of 5,012 MiB = 4.89 GiB
  • that an artifact with max size can be received, the incoming buffer size is 4.8 GiB (would have expected 4.9, but maybe a rounding error)
  • free space buffer size + incoming buffer size = 7.85 GiB
  • target cache size is 6.7 GiB
  • 7.85 > 6.7 => nothing can be added to the cache

But that’s really just a wild guess.