4

So, Jenkins has this async resource disposer plugin which I have it installed.

My question: Is there a way to clean up the resources that the plugin collects because if I don't clean up manually, it seems to consume more and more CPU every time?

Sometimes it just makes Jenkins unresponsive.

So, is there a better way to clean up these resources? As of now, I don't care with what it's capturing so is there an issue if I just remove the plugin or a way of using the API to clean up these resources every night?

Shadow
  • 8,749
  • 4
  • 47
  • 57
Jason
  • 2,246
  • 6
  • 34
  • 53

2 Answers2

3

I found a workaround in one of the jenkins ticket created by someone:

Ticket: https://issues.jenkins-ci.org/browse/JENKINS-24824

curl -s http://${JENKINS_URL}/administrativeMonitor/AsyncResourceDisposer/ -u${UTILITY_USER}:${UTILITY_PW} | tr '"' '\n' | grep 'stop-tracking' | cut -d '-' -f 3 | sort -n | while read ASYNC_THREAD; do curl http://${JENKINS_URL}/administrativeMonitor/AsyncResourceDisposer/stopTracking -u${UTILITY_USER}:${UTILITY_PW} -X POST --data "id=${ASYNC_THREAD}"; done
Jason
  • 2,246
  • 6
  • 34
  • 53
3

Disclaimer: I am the plugin author.

The items the plugin tracks are those Jenkins failed to dispose in an automated way and they require admin attention in deleting those resources. As suggested by @Jason, there is a way to get Jenkins to stop tracking the resources, but it will effectively let the resources live forever - which is rarely what you want.

Verify what the resources are and why they are not considered disposed by Jenkins. Might be a bug, might be a problem with your infra. Trashing the resource disposer entries is hiding the real problem in your deployment.

Oliver Gondža
  • 3,386
  • 4
  • 29
  • 49