OrchardCMS / OrchardCore

Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
https://orchardcore.net
BSD 3-Clause "New" or "Revised" License
7.45k stars 2.41k forks source link

Tenant diagnostics #578

Open weedkiller opened 7 years ago

weedkiller commented 7 years ago

Hi, in both Orchard versions there is no help explanation on handling tenant/data/members in the modules development, and when to choose the widget option vs module, perhaps a new end-toend sample on plugin modules and upgrading from v1 to v2 would aid the devs

The multi-tenant module is available but as a developer we need more help.

thanks

Jetski5822 commented 7 years ago

Most of this we already have I think.... except maybe the last two?

sebastienros commented 7 years ago

I don't see any solution to find out RAM usage per tenant. We could do snapshots before and after starting a tenant, but it would be useless as it will depend on dynamic behaviors too.

Phiph commented 7 years ago

Instead of RAM usage which how about count the amount of requests a tenant has received in the past hour?

DaRosenberg commented 7 years ago

RAM usage is all but impossible - I actually looked into this a while back. There are only two ways:

  1. Go through all objects in the root DI container of the tenant and binary-serialize them, and check the size of the serialized output. This is extremely slow and also inaccurate, because serialized size might be very different from memory footprint.
  2. Use the profiling API from an external process. Very complex and slows down the host process, and also probably requires the host process to be restarted. Probably not feasible.

Some other metrics per tenant might be helpful though:

weedkiller commented 7 years ago

I realize the RAM usage changes, but don't you think AWS, WP etc display a RAM usage at that point in time.

IMHO - this will help people report any abnormal issues, which could help with troubleshooting or performance.

DaRosenberg commented 7 years ago

@weedkiller the difficult part is not RAM usage per se, but rather RAM usage per tenant as you mentioned in your initial post.

sebastienros commented 5 years ago

Last I measured on the blog recipes, one tenant took 3-4MB. It will always depend on the number of modules you have though.

weedkiller commented 5 years ago

@sebastienros @DaRosenberg @Phiph right now, we dont know if there is a run away tenant or a memory leak.

For e.g. I am using ABP boiler plate, while thats well organized, we would have never caught many issues where the RAM usage kept growing, signalling some issue.

Similarly, if you want to community to be able to monitor even at the high-level, it would be nice to be able to click a menu item to access and see the orchard server stats, perhaps a troubleshooting or diagnostics script.

sebastienros commented 5 years ago

Sorry, I must have lost context on the issue when I closed it, you actually want diagnostics tools? This is a very reasonable ask, I am reopening the issue.