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

Extremely slow start of the OracleDatabase 19.3 se2 docker container #1480

Closed
vmassol opened this issue Jan 3, 2020 · 9 comments
Closed

Comments

@vmassol
Copy link

vmassol commented Jan 3, 2020

Hi, I successfully built the docker image for OracleDatabase 19.3 se2.

The issue is when I start it. I've tried this on 2 different machines (on a Mac and one a Linux system) and in both cases it takes more than 35 minutes to start!

I started it with docker run -p 1521:1521 -p 5500:5500 -e ORACLE_SID=xwiki -e ORACLE_PDB=xwikipdb -e ORACLE_PWD=xwiki oracle/database:19.3.0-se2 (note: I also tried by mapping a local directory for the DB files with the same slow result).

The part that is extremely slow is this part:

...
Prepare for db operation
8% complete
Copying database files
31% complete
Creating and starting Oracle instance
32% complete
36% complete
40% complete
43% complete
46% complete
Completing Database Creation
51% complete
54% complete
Creating Pluggable Databases
58% complete
77% complete
Executing Post Configuration Actions
100% complete
...

We used to use a Oracle 11g docker image execute test XWiki (https://xwiki.org) on it to validate that we support the Oracle DB and it was working ok (about 2mn to start it). We'd like to validate against a more recent version, which is why I've been trying using version 19.3 for the past 2 days.

However with a startup time of 35+ minutes it's impossible for us to use it for our tests. We start and stop the container hundreds of times across all our test suite (hundreds if not thousands of tests across different modules).

So some questions:

  1. Is that startup expected? Is that what everyone is experiencing? I should note that the machines on which I tried it are quite large and beefy machines with lots of CPU and RAM (and I didn't put any resource limits).
  2. Is there something that can be done to speed it up so that it starts in about 2-3 minutes?

Thanks a lot
-Vincent
XWiki open source commmitter

@ggajos
Copy link

ggajos commented Jan 7, 2020

@vmassol I posted a blog post (instruction), why it is taking so much time and how it can be optimized here: https://medium.com/@ggajos/drop-db-startup-time-from-45-to-3-minutes-in-dockerized-oracle-19-3-0-552068593deb

@vmassol
Copy link
Author

vmassol commented Jan 8, 2020

@ggajos Thanks a lot, very useful. I actually used some Oracle 19.3 images that were supposed to do this but they were still quite slow to start if I remember correctly: https://hub.docker.com/r/quillbuilduser/oracle-18-xe

3 minutes is still very long to start to DB (we have hundreds if not thousands of tests in different modules) so that a lot of hours just to start/stop the Oracle DB... ;) But not much we can do about this except drop testing on Oracle or test less often on it.

The main issue with your solution is that we need to store the new image somewhere so that all devs can get it, including our CI. So this means having to setup a Docker Registry, which we've avoided so far (lots of hassle and maintenance required). We're trying to use only dockerhub.

Thanks!

@CamilYed
Copy link

Chceck this walk around https://github.com/KamilJedrzejuk/oracle18.4.0xe-docker

@Djelibeybi
Copy link
Member

Chceck this walk around https://github.com/KamilJedrzejuk/oracle18.4.0xe-docker

Why not sign the Oracle Contributor Agreement and submit that as an additional Dockerfile for this repo?

@CamilYed
Copy link

CamilYed commented Mar 16, 2020

@vmassol
@mark-au
@Djelibeybi this repo had some issues.
You can check this https://github.com/KamilJedrzejuk/oracle18c-xe

@gvenzl gvenzl closed this as completed Oct 16, 2020
@patric-r
Copy link

@gvenzl Has this issue been finally fixed?

@rafaelosoto
Copy link

This issue has not been fixed and probably stems from how oracle approaches software as a whole.

In general when developing a docker application you start from the ground up making sure it is quick to start so that it is available for other services(especially if you can store database data elsewhere)

Oracle's approach is to have an existing slow product and shove it into a container.

@KamilJedrzejuk thank you so much will give this a shot. Not sure why this issue is closed it is one of the biggest issues in this repo.

@CamilYed
Copy link

CamilYed commented Oct 20, 2020

Thanks for the clarification

@mh5
Copy link

mh5 commented Dec 21, 2023

I found a way to move away the slowness from the first container startup to the image build. In the Dockerfile, I added the below line, right before the CMD line.

RUN $ORACLE_BASE/$RUN_FILE --nowait

The file $ORACLE_BASE/$RUN_FILE is the entrypoint script itself. That is why I found it.

By executing the entrypoint once during the image build, the database runs and the initializes itself. The --nowait is a parameter that makes the entrypoint terminate after initialization, I am thankful it exists.

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

No branches or pull requests

9 participants