简体   繁体   English

Azure WebJob:BlobTrigger与QueueTrigger资源使用情况

[英]Azure WebJob: BlobTrigger vs QueueTrigger resource usage

I created a WebJob project to backup images from Azure to Amazon that used the BlobTrigger attribute for the first parameter in the method 我创建了一个WebJob项目来备份从Azure到亚马逊的图像,该图像使用BlobTrigger属性作为方法中的第一个参数

    public static async Task CopyImage([BlobTrigger("images/{name}")] ICloudBlob image, string name, TextWriter log)
    {
        var imageStream = new MemoryStream();
        image.DownloadToStream(imageStream);
        await S3ImageBackupContext.UploadImageAsync(name, imageStream);
    }

Then I read that the BlobTrigger is based on the best effort basis in the document How to use Azure blob storage and changed it to a QueueTrigger. 然后我读到BlobTrigger基于文档中的尽力而为基础 如何使用Azure blob存储并将其更改为QueueTrigger。

Both works perfectly fine :-) so it's not a problem but a question. 两者都完美无缺:-)所以这不是一个问题,而是一个问题。 Since I deployed the change the CPU and Memory usage of the WebJob looks like 自从我部署了更改后,WebJob的CPU和内存使用情况就像

CPU内存使用情况

Can somebody explain me the reason for the drop of memory and CPU usage? 有人可以解释一下内存和CPU使用率下降的原因吗? Also the data egress went down. 数据出口也下降了。

Very interesting. 很有意思。

I think you're the only one who can answer that question. 我想你是唯一能回答这个问题的人。

Do a remote profile for both blob and queue versions, see which method eats up that CPU time: 为blob和队列版本执行远程配置文件,查看哪个方法占用了CPU时间:
https://azure.microsoft.com/en-us/blog/remote-profiling-support-in-azure-app-service/ https://azure.microsoft.com/en-us/blog/remote-profiling-support-in-azure-app-service/

For memory consumption you probably need to grab a memory dump: 对于内存消耗,您可能需要获取内存转储:
https://blogs.msdn.microsoft.com/waws/2015/07/01/create-a-memory-dump-for-your-slow-performing-web-app/ https://blogs.msdn.microsoft.com/waws/2015/07/01/create-a-memory-dump-for-your-slow-performing-web-app/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM