eclipse-che / che

Kubernetes based Cloud Development Environments for Enterprise Teams
http://eclipse.org/che
Eclipse Public License 2.0
6.96k stars 1.19k forks source link

Workspace Agent is slow to boot on macOs #6169

Closed benoitf closed 6 years ago

benoitf commented 7 years ago

Running the workspace agent is quite slow, especially when I/O is not so fast. Which is the case on my environment : macOs / docker

Reproduction Steps: Start Eclipse Che workspace, and look at the time used by the workspace agent to boot.

Running profiler shows that it can run faster.

PRs:

garagatyi commented 7 years ago

Can you elaborate on ways to make it faster because it is not clear from the description to me

benoitf commented 7 years ago

@garagatyi I'm updating the issue. Some PR will be linked

skabashnyuk commented 7 years ago

Can we see numbers of perfomance report before we start applaing some changes?

benoitf commented 7 years ago

@skabashnyuk On my computer, on docker or minishift the start time of the agent is reduced by 5 seconds (15 seconds before to less than 10 seconds after)

skabashnyuk commented 7 years ago

Perfect. What is the timings for container start, individual components? What are the results on different OS OSX vs Linux?

benoitf commented 7 years ago

@skabashnyuk I suppose your comment is a little bit odd. In current design, code is eating memory, cpu and I/O and what my PR are doing is that it reduces memory, cpu and I/O without changing the logic. So there is no macOS vs Linux vs Windows. Also reducing I/O is good when you've several of workspaces starting on the same physical machine. (and memory is good as well)

skabashnyuk commented 7 years ago

@benoitf I just want to understand what is the price and what is the profit.

benoitf commented 7 years ago

@skabashnyuk I see only profit ?

skabashnyuk commented 7 years ago

I think that topic you've touch about performance is very important and at the same time it very sensitive to environment and opinions of persons who are doing measurements. In this case, to avoid any speculation I'm asking to base this work on some scientifical data, profiler data, logs report. It can help to better understand the way how to solve existed problems and do not make problems in future.

Closer to business:

I think pure profit, except some subjective codestyle questions. They are quite easy money, interesting to see how much time from your 5 sec it takes.

This is not so easy because it changes some fundamental approaches that we use for a while. Would be nice to see how much time we won in this time, to understand if it's worth of time discussing circumstances.

benoitf commented 7 years ago

@skabashnyuk work has been done on profiler data. It's not speculation. Any person running profiler will see that. How do you think I was able to detect some singletons taking up time to start ???

Also I start to think you never read any document on how to improve applications startup time on Tomcat

skabashnyuk commented 7 years ago

@skabashnyuk work has been done on profiler data. It's not speculation. Any person running profiler will see that. How do you think I was able to detect some singletons taking up time to start

ok. Can you share this data? About what level of numbers we are talking about, nano seconds, milliseconds, ten's of seconds.

Also I start to think you never read any document on how to improve applications startup time on Tomcat

It was rude and I do not think it is related to the topic. Every improvement has its price and in case of https://github.com/eclipse/che/pull/6186 I doubt that it's worth it.

benoitf commented 7 years ago

@skabashnyuk let say the opposite: why do you think app server have options to avoid the scan of classes if it was nano seconds ?

benoitf commented 7 years ago

Also guess what is the first point of https://wiki.apache.org/tomcat/HowTo/FasterStartUp

It is Jar Scanning

Among the scans the annotation scanning is the slowest. That is because each class file (except ones in ignored JARs) has to be read and parsed looking for annotations in it.

skabashnyuk commented 7 years ago

@benoitf before doing some conclusions, I expect some sort of performance report like this https://github.com/codenvy/codenvy/issues/1466#issuecomment-270922181 on which base we can elaborate. And yes I do know what Jar Scanning is. No need to convince me what it takes time.

slemeur commented 7 years ago

@skabashnyuk : Why don't we have automated performance tests and profiling suites like this https://github.com/codenvy/codenvy/issues/1466#issuecomment-270922181 ?

We should track and monitor that in an automated fashion. As we don't want to introduce functional regression, and we have functional tests for that, we don't want to introduce performances regressions either.

skabashnyuk commented 7 years ago

@slemeur good question. I don't know. May be because it's not what easy to automate.

benoitf commented 7 years ago

Here is a screencast https://gifyu.com/image/MSKH

Environment: macOS 16.7.0 / docker

docker:

$ docker version
Client:
 Version:      17.07.0-ce
 API version:  1.31
 Go version:   go1.8.3
 Git commit:   8784753
 Built:        Tue Aug 29 17:41:08 2017
 OS/Arch:      darwin/amd64

Server:
 Version:      17.07.0-ce
 API version:  1.31 (minimum version 1.12)
 Go version:   go1.8.3
 Git commit:   8784753
 Built:        Tue Aug 29 17:46:50 2017
 OS/Arch:      linux/amd64
 Experimental: false

First, I start che 5.17.0 then my "optimized che nightly" including the 4 PRs of this issue then again 5.17.0

result are : around 10s for 5.17.0 around 6s for optimized che

garagatyi commented 7 years ago

@benoitf can you clarify whether you got these results by applying all 4 improvements? And what was the target OS?

benoitf commented 7 years ago

@garagatyi I've updated my previous comment adding macOs/docker version and adding the fact that I had applied the 4 improvements

garagatyi commented 7 years ago

thanks

benoitf commented 7 years ago

@garagatyi if it's not clear enough, let me know I can add details

garagatyi commented 7 years ago

It's clear for me. From what I experienced on Mac (not with the best disk Apple provides), it is usually much slower than Linux in disk operations (because of Docker4Mac virtualization stuff). So it would be interesting to see results on Linux and especially on openshift instance (not virtualized). And I'm not forcing you to do those tests, just saying my thoughts out loud. BTW in case of development on Mac it was very slow because of heavy usage of mounted binaries. Do you know whether it works in the same way now?

benoitf commented 7 years ago

also I have not yet opened issues but during the profiling I've found other objects that takes time to initialize

org.eclipse.jdt.internal.ui.JavaPlugin.start
     org.eclipse.jdt.internal.core.JavaCorePreferenceInitializer.initializeDefaultPreferences() 

org.eclipse.che.api.languageserver.service.TextDocumentService.configureMethods() 

SimpleGeneratorStrategy : init of vfs

org.eclipse.che.api.project.server.WorkspaceHolder$$FastClassByGuice$$d17e5c7e.newInstance(int, Object[]) 

ResourcesPlugin:
  new workspace
      new WorkManager
benoitf commented 7 years ago

@garagatyi