Merhabalar, Gecen gun yaptigimiz mobil projeyi yayina aldik.40 user ile API server'in ram kullanimi %90 lara cikti. Ram artiyor surekli ve bosalmiyor. Monitor edip restart ediyorum cozum bulana kadar fakat bir cozum bulamadim 2 gundur uyumadim birseyi gozden kaciriyorum yardimci olursaniz cok sevinirim. Hardware: 4 GB Memory / 80 GB Disk / 2 CPU - CentOS 7.4 x64 Software: c# dot net core 2.0.8 & mongo 3.6.2 visual studio communtiy for mac ile gelistirildi. Server: Nginx Nginx configinde birsey atlamis olabilirim conf dosyasinda bir hata var mi sizce? API buludungu configuration location /app Kestrel garbage collectorun calismadigindan supheleniyorum. Daha once kestrel ile is yapmadim fakat bu web server saniyede 1.2m istege yanit verebiliyor benchmark testlerindeki bilgiye gore. GarbageCollection'un enabled olmadigini dusundum runtimeconfiguration. json olusturup GC. Server = true; ile api'yi baslattim hic bir sey degismedi. ApplicationInsights development icin data topladigini buldum disable etmek icin startup. cs ye TelemetryConfiguration. Active. DisableTelemetry = true; ekledim yine birsey degismedi ram artmaya devam ediyor. Startup. cs'de service sinifinlarini ioc ye singleton olarak ekliyorum. Ilk yayina cikarken AddTransient kullanmistim AddSingleton'a cevirdim birsey degismedi. services. AddSingleton<IMessageCollection, MessageCollection> ; ApiController constructoruna serviceleri new keywordu olmadan olusturuyorum. public class MessageController : Controller { readonly IMessageCollection _messageCollection; readonly IConfiguration _config; public MessageController } Context repository pattern'inde bir sorun olabilir mi : public class MongoContext { public IMongoDatabase _database = null; public MongoContext { if { Console. WriteLine ; var client = new MongoClient ; if else } } public IMongoCollection<Message> Messages => _database. GetCollection<Message> ; } public interface IMessageCollection public class MessageCollection : IMessageCollection { readonly MongoContext _context = null; public MessageCollection public virtual async Task<Message> GetByIdAsync } dotnet --info Product Information: Version: 2.1.200 Commit SHA-1 hash: 2edba8d7f1 Runtime Environment: OS Name: centos OS Version: 7 OS Platform: Linux RID: centos.7-x64 Base Path: /usr/share/dotnet/sdk/2.1.200/ Microsoft. NET Core Shared Framework Host Version : 2.0.7 Build : 2d61d0b043915bc948ebf98836fefe9ba942be11 Nginx. conf user nginx; worker_processes auto; error_log /var/log/nginx/error. log; pid /run/nginx. pid; include /usr/share/nginx/modules/ . conf; events http { log_format main '$remote_addr - $remote_user "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access. log main; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; include /etc/nginx/mime. types; default_type application/octet-stream; limit_req_zone $binary_remote_addr zone=one:10m rate=5r/s; server_tokens off; client_body_timeout 10; client_header_timeout 10; send_timeout 10; proxy_buffer_size 128k; proxy_buffers 4 256k; proxy_busy_buffers_size 256k; large_client_header_buffers 4 16k; #include /etc/nginx/conf. d/ . conf; server upstream io_nodes server { listen :488 ssl; server_name www.app.com app.com; ssl on; ssl_certificate /etc/ssl/app.com. bundle. crt; ssl_certificate_key /etc/ssl/app.com. key; ssl_protocols TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH"; ssl_ecdh_curve secp384r1; ssl_session_cache shared:SSL:10m; ssl_session_tickets off; ssl_stapling on; #ensure your cert is capable ssl_stapling_verify on; #ensure your cert is capable add_header Strict-Transport-Security "max-age=63072000; preload"; add_header X-Frame-Options DENY; add_header X-Content-Type-Options nosniff; client_max_body_size 20M; include /etc/nginx/default. d/ . conf; error_page 404 /404.html; location = /40x.html error_page 500 502 503 504 /50x.html; location = /50x.html location / } server { listen :443 ssl; server_name www.app.com app.com; ssl on; ssl_certificate /etc/ssl/app.com. bundle. crt; ssl_certificate_key /etc/ssl/app.com. key; ssl_protocols TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH"; ssl_ecdh_curve secp384r1; ssl_session_cache shared:SSL:10m; ssl_session_tickets off; ssl_stapling on; #ensure your cert is capable ssl_stapling_verify on; #ensure your cert is capable add_header Strict-Transport-Security "max-age=63072000; preload"; add_header X-Frame-Options DENY; add_header X-Content-Type-Options nosniff; client_max_body_size 20M; include /etc/nginx/default. d/ . conf; error_page 404 /404.html; location = /40x.html error_page 500 502 503 504 /50x.html; location = /50x.html location / location /app }#server }#http override tarafından 10/May/18 22:19 tarihinde düzenlenmiştir gl