Skip to content

Commit

Permalink
add tunable number of libuv threads
Browse files Browse the repository at this point in the history
  • Loading branch information
tomzo committed Nov 30, 2018
1 parent f846f5a commit 7201f30
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 11 deletions.
2 changes: 2 additions & 0 deletions paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ nuget McMaster.Extensions.CommandLineUtils
nuget Microsoft.NETCore.App 2.1.4
nuget Microsoft.AspNetCore.App 2.1.4
nuget Microsoft.AspNetCore.TestHost
nuget Microsoft.AspNetCore.Server.Kestrel
nuget Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv
nuget Microsoft.Azure.Search
nuget Microsoft.Data.SQLite
nuget Microsoft.EntityFrameworkCore.Design
Expand Down
22 changes: 15 additions & 7 deletions paket.lock
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ NUGET
Newtonsoft.Json (>= 10.0.3)
System.Threading.Tasks.Dataflow (>= 4.8)
System.ValueTuple (>= 4.4)
Libuv (1.10)
Microsoft.NETCore.Platforms (>= 1.0.1)
McMaster.Extensions.CommandLineUtils (2.2.5)
System.ComponentModel.Annotations (>= 4.4.1)
Microsoft.AspNet.WebApi.Client (5.2.6) - restriction: || (== netcoreapp2.1) (&& (== netstandard2.0) (>= netcoreapp2.1))
Expand Down Expand Up @@ -245,7 +247,7 @@ NUGET
Microsoft.AspNetCore.Http (>= 2.1.1)
Microsoft.Extensions.Logging.Abstractions (>= 2.1.1)
Microsoft.Extensions.Options (>= 2.1.1)
Microsoft.AspNetCore.Cors (2.1.1) - restriction: || (== netcoreapp2.1) (&& (== netstandard2.0) (>= netcoreapp2.1))
Microsoft.AspNetCore.Cors (2.1.1)
Microsoft.AspNetCore.Http.Extensions (>= 2.1.1)
Microsoft.Extensions.Configuration.Abstractions (>= 2.1.1)
Microsoft.Extensions.DependencyInjection.Abstractions (>= 2.1.1)
Expand Down Expand Up @@ -301,7 +303,7 @@ NUGET
Microsoft.Extensions.Options (>= 2.1.1)
System.Diagnostics.DiagnosticSource (>= 4.5)
System.Reflection.Metadata (>= 1.6)
Microsoft.AspNetCore.Hosting.Abstractions (2.1.1) - restriction: || (== netcoreapp2.1) (&& (== netstandard2.0) (>= netcoreapp2.1))
Microsoft.AspNetCore.Hosting.Abstractions (2.1.1)
Microsoft.AspNetCore.Hosting.Server.Abstractions (>= 2.1.1)
Microsoft.AspNetCore.Http.Abstractions (>= 2.1.1)
Microsoft.Extensions.Hosting.Abstractions (>= 2.1.1)
Expand Down Expand Up @@ -530,12 +532,12 @@ NUGET
System.Numerics.Vectors (>= 4.5)
System.Runtime.CompilerServices.Unsafe (>= 4.5.2)
System.Security.Principal.Windows (>= 4.5.1)
Microsoft.AspNetCore.Server.Kestrel (2.1.3) - restriction: || (== netcoreapp2.1) (&& (== netstandard2.0) (>= netcoreapp2.1))
Microsoft.AspNetCore.Server.Kestrel (2.1.3)
Microsoft.AspNetCore.Hosting (>= 2.1.1)
Microsoft.AspNetCore.Server.Kestrel.Core (>= 2.1.3)
Microsoft.AspNetCore.Server.Kestrel.Https (>= 2.1.3)
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (>= 2.1.3)
Microsoft.AspNetCore.Server.Kestrel.Core (2.1.3) - restriction: || (== netcoreapp2.1) (&& (== netstandard2.0) (>= netcoreapp2.1))
Microsoft.AspNetCore.Server.Kestrel.Core (2.1.3)
Microsoft.AspNetCore.Hosting.Abstractions (>= 2.1.1)
Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions (>= 2.1.3)
Microsoft.AspNetCore.WebUtilities (>= 2.1.1)
Expand All @@ -548,12 +550,18 @@ NUGET
System.Runtime.CompilerServices.Unsafe (>= 4.5.1)
System.Security.Cryptography.Cng (>= 4.5)
System.Threading.Tasks.Extensions (>= 4.5.1)
Microsoft.AspNetCore.Server.Kestrel.Https (2.1.3) - restriction: || (== netcoreapp2.1) (&& (== netstandard2.0) (>= netcoreapp2.1))
Microsoft.AspNetCore.Server.Kestrel.Https (2.1.3)
Microsoft.AspNetCore.Http.Abstractions (>= 2.1.1)
Microsoft.AspNetCore.Server.Kestrel.Core (>= 2.1.3)
Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions (2.1.3) - restriction: || (== netcoreapp2.1) (&& (== netstandard2.0) (>= netcoreapp2.1))
Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions (2.1.3)
Microsoft.AspNetCore.Connections.Abstractions (>= 2.1.3)
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (2.1.3) - restriction: || (== netcoreapp2.1) (&& (== netstandard2.0) (>= netcoreapp2.1))
Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv (2.1.3)
Libuv (>= 1.10)
Microsoft.AspNetCore.Hosting.Abstractions (>= 2.1.1)
Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions (>= 2.1.3)
Microsoft.Extensions.Logging.Abstractions (>= 2.1.1)
Microsoft.Extensions.Options (>= 2.1.1)
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (2.1.3)
Microsoft.AspNetCore.Hosting.Abstractions (>= 2.1.1)
Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions (>= 2.1.3)
Microsoft.Extensions.Options (>= 2.1.1)
Expand Down
3 changes: 2 additions & 1 deletion src/LiGet/LiGet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<SpaRoot>$(MSBuildProjectDirectory)\..\LiGet.UI\</SpaRoot>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<ItemGroup>
<!-- Don't publish the SPA source files, but do show them in the project files list -->
Expand All @@ -28,4 +29,4 @@
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build" />
</Target>
<Import Project="..\..\.paket\Paket.Restore.targets" />
</Project>
</Project>
12 changes: 9 additions & 3 deletions src/LiGet/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,13 @@ await provider
app.Execute(args);
}

public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
public static IWebHostBuilder CreateWebHostBuilder(string[] args) {
var b = WebHost.CreateDefaultBuilder(args);
string threadCount = Environment.GetEnvironmentVariable("LIGET_LIBUV_THREAD_COUNT");
if(!string.IsNullOrEmpty(threadCount))
b.UseLibuv(opts => opts.ThreadCount = int.Parse(threadCount));

b.UseStartup<Startup>()
.ConfigureLogging((context, builder) =>
{
var graylogSection = context.Configuration.GetSection("Graylog");
Expand All @@ -106,6 +110,8 @@ public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
// be enforced by a reverse proxy server, like IIS.
options.Limits.MaxRequestBodySize = null;
});
return b;
}

public static IHostBuilder CreateHostBuilder(string[] args)
{
Expand Down
2 changes: 2 additions & 0 deletions src/LiGet/paket.references
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Microsoft.AspNetCore.App
Microsoft.AspNetCore.Cors
Microsoft.AspNetCore.Server.Kestrel
Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv
McMaster.Extensions.CommandLineUtils
Microsoft.Data.SQLite
Microsoft.EntityFrameworkCore.Relational
Expand Down

0 comments on commit 7201f30

Please sign in to comment.