-
Hi I am using Ocelot 15.0.6 as a gateway. Since Ocelot supports multiple configuration files. Previously I include seven different configurations files with the routes of different projects API, The problem occurred when a new file is added with more than 80 routes in it. After adding that file The ocelot took too long at startup that the application got stuck and shut down later when deploying gateway. The current behavior of ocelot is unacceptable, application should not take much time for a startup. How can I optimize that time or speed up the startup time of ocelot at production? Steps to Reproduce the ProblemAdd multiple configuration files with a large no of routes Specifications
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
@heizel184 are you still facing it on latest versions? |
Beta Was this translation helpful? Give feedback.
-
@heizel184 Dear Hina! Your issue is quite outdated because of legacy version 15.0.6.
Are you sure that all files are valid? So, have all these files valid JSON formatting and syntax?
Deployment can fail because of critical error when starting up the app... |
Beta Was this translation helpful? Give feedback.
-
How many? |
Beta Was this translation helpful? Give feedback.
-
Following result based on #1964 HeavyRoutesStartupBenchmark.StartOcelotWithLargeConfigurations: DefaultJob
|
Method | Mean | Error | StdDev | StdErr | Median | Min | Q1 | Q3 | Max | Op/s | Gen0 | Gen1 | Allocated |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
StartOcelotWithLargeConfigurations | 7.135 s | 0.2059 s | 0.5808 s | 0.0605 s | 6.959 s | 5.827 s | 6.815 s | 7.477 s | 8.815 s | 0.1402 | 45000.0000 | 3000.0000 | 191.49 MB |
// * Warnings *
Environment
Summary -> Benchmark was executed with attached debugger
// * Hints *
Outliers
HeavyRoutesStartupBenchmark.StartOcelotWithLargeConfigurations: Default -> 8 outliers were removed (8.98 s..14.23 s)
// * Legends *
Mean : Arithmetic mean of all measurements
Error : Half of 99.9% confidence interval
StdDev : Standard deviation of all measurements
StdErr : Standard error of all measurements
Median : Value separating the higher half of all measurements (50th percentile)
Min : Minimum
Q1 : Quartile 1 (25th percentile)
Q3 : Quartile 3 (75th percentile)
Max : Maximum
Op/s : Operation per second
Gen0 : GC Generation 0 collects per 1000 operations
Gen1 : GC Generation 1 collects per 1000 operations
Allocated : Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)
1 s : 1 Second (1 sec)
// * Diagnostic Output - MemoryDiagnoser *
// ***** BenchmarkRunner: End *****
Run time: 00:15:35 (935.39 sec), executed benchmarks: 1
Global total time: 00:15:42 (942.7 sec), executed benchmarks: 1
// * Artifacts cleanup *
Artifacts cleanup is finished
Beta Was this translation helpful? Give feedback.
@heizel184
Just keep all routes in one file!
To be fair, I don't understand creation of a separate file for each route! It is strange. You could use another merging strategy: for example create separate file for each downstream host to keep all routes to this downstream service in one .json file. I believe your number of files will decrease in times.
But we are working now on your user scenario when there are a lot of tiny files... We will try to check Ocelot behavior having 50-100 files in configuration. Please watch this PR: #1856