Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

H2 DB is reopened on every request #1652

Closed
XANi opened this issue Feb 1, 2016 · 8 comments
Closed

H2 DB is reopened on every request #1652

XANi opened this issue Feb 1, 2016 · 8 comments

Comments

@XANi
Copy link

XANi commented Feb 1, 2016

I've tried default install (just installing package, no setup) and I've noticed it is awfully slow, even with just one job in the system. Strace after every request looks a bit like that (that was just clicking nodes buttons, or jobs button):

[pid 26787] 11:48:56 open("/var/lib/rundeck/data/rundeckdb.h2.db", O_RDWR|O_CREAT, 0666) = 211
[pid 26787] 11:48:56 fstat(211, {st_mode=S_IFREG|0664, st_size=163840, ...}) = 0

and then it gets closed once request ends:

[pid 26787] 11:48:57 lseek(211, 0, SEEK_CUR) = 8192
[pid 26787] 11:48:57 lseek(211, 0, SEEK_END) = 2260992
[pid 26787] 11:48:57 lseek(211, 8192, SEEK_SET) = 8192
[pid 26787] 11:48:57 lseek(211, 0, SEEK_CUR) = 8192
[pid 26787] 11:48:57 ftruncate(211, 163840) = 0
[pid 26787] 11:48:57 lseek(211, 8192, SEEK_SET) = 8192
[pid 26787] 11:48:57 close(211)         = 0

Shouldn't it be kept open ? It wastes a lot of time first trying to lock db, read headers than read data and that happens on each request

@ahonor
Copy link
Contributor

ahonor commented Feb 1, 2016

@XANi what are your JVM memory settings (i.e. max heap size)?

@XANi
Copy link
Author

XANi commented Feb 1, 2016

Just the default package uses (rundeck-2.6.2-1-GA.deb) which is -Xmx1024m -Xms256m -XX:MaxPermSize=256m

I don't think it is gc/memory related issue, here is snapshot from jstat when running

☠ jstat -gc 23175 5000
 S0C    S1C    S0U    S1U      EC       EU        OC         OU       PC     PU    YGC     YGCT    FGC    FGCT     GCT
41472.0 43008.0  0.0    0.0   254464.0 70889.5   290304.0   157304.3  175616.0 88122.6     15    0.662   1      1.281    1.943
41472.0 43008.0  0.0    0.0   254464.0 70889.5   290304.0   157304.3  175616.0 88122.6     15    0.662   1      1.281    1.943
41472.0 43008.0  0.0    0.0   254464.0 75150.9   290304.0   157304.3  175616.0 88163.2     15    0.662   1      1.281    1.943
41472.0 43008.0  0.0    0.0   254464.0 89202.1   290304.0   157304.3  175616.0 88281.7     15    0.662   1      1.281    1.943
41472.0 43008.0  0.0    0.0   254464.0 124674.7  290304.0   157304.3  175616.0 88649.4     15    0.662   1      1.281    1.943
41472.0 43008.0  0.0    0.0   254464.0 127228.4  290304.0   157304.3  175616.0 88664.9     15    0.662   1      1.281    1.943
41472.0 43008.0  0.0    0.0   254464.0 151224.9  290304.0   157304.3  175616.0 89390.6     15    0.662   1      1.281    1.943
41472.0 43008.0  0.0    0.0   254464.0 151224.9  290304.0   157304.3  175616.0 89390.6     15    0.662   1      1.281    1.943
41472.0 43008.0  0.0    0.0   254464.0 178098.6  290304.0   157304.3  175616.0 89440.5     15    0.662   1      1.281    1.943
41472.0 43008.0  0.0    0.0   254464.0 191932.5  290304.0   157304.3  175616.0 89462.3     15    0.662   1      1.281    1.943
41472.0 43008.0  0.0    0.0   254464.0 194051.4  290304.0   157304.3  175616.0 89507.4     15    0.662   1      1.281    1.943
41472.0 43008.0  0.0    0.0   254464.0 204478.3  290304.0   157304.3  175616.0 89531.2     15    0.662   1      1.281    1.943
41472.0 43008.0  0.0    0.0   254464.0 211992.1  290304.0   157304.3  175616.0 89571.7     15    0.662   1      1.281    1.943
41472.0 43008.0  0.0    0.0   254464.0 217758.9  290304.0   157304.3  175616.0 89576.6     15    0.662   1      1.281    1.943

Looks like GC wasnt even ran during those requests

I was just clicking jobs and nodes tabs few times (totally empty clean install, 1 project with zero tasks) and all requests took more than 6 seconds (normal hard drive, no ssd)

@ahonor
Copy link
Contributor

ahonor commented Feb 1, 2016

@XANi what is the Model Source for the project?

@XANi
Copy link
Author

XANi commented Feb 1, 2016

File. It is just default install, I haven't changed anything

@XANi
Copy link
Author

XANi commented Feb 1, 2016

I've tried to move whole /var/lib onto ramdisk/tmpfs and it made requests take ~1s or shorter so it is definitely something related to disk access

@ahonor
Copy link
Contributor

ahonor commented Nov 17, 2017

Please reopen if this remains a concern

@ahonor ahonor closed this as completed Nov 17, 2017
@XANi
Copy link
Author

XANi commented Nov 19, 2017

It looks faster in 2.10 but I can't really compare because after upgrading to 2.10 all jobs disappeared... i just had them in yaml dir but now that isn't even an option and I'm confused why...

@ahonor
Copy link
Contributor

ahonor commented Nov 19, 2017

@XANi Rundeck does not automatically load job definitions from a directory. Try using the rd CLI to reload them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants