worker

How to profile a PHP shell script app or worker using Blackfire

情到浓时终转凉″ 提交于 2019-12-07 17:26:26
问题 I noticed that when I have an endless worker I cannot profile PHP shell scripts. Because when it's killed it doesn't send the probe. What changes shall I do? 回答1: When you are trying to profile a worker which is running an endless loop. In this case you have to manually edit your code to either remove the endless loop or instrument your code to manually call the close() method of the probe (https://blackfire.io/doc/manual-instrumentation). That's because the data is sent to the agent only

How to setup event log for .NET Core 3.0 Worker Service

走远了吗. 提交于 2019-12-07 04:08:25
问题 I'm working with the new Worker Service app template with .NET Core 3.0 Preview and am trying to add event logging using the AddEventLog method. However, I cannot see any of my logs via the Event Viewer in Windows. I have a very simple Worker app setup and have configured logging in the Program.cs file as follows: public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .UseWindowsService() .ConfigureLogging((context, logging) => { logging.AddEventLog(new

How to get the current list of Worker Request from IIS using C#?

て烟熏妆下的殇ゞ 提交于 2019-12-06 08:22:11
问题 I am writing the code for a RESTful web service status page. I was wondering if there is away to get the current request from IIS into C#. I am using IIS 7.0 and the info I want is under IIS > Worker procecces > ASP.NET v4.0 > Requests 回答1: You can use the GetRequests method of the WorkerProcess type. This type is located in the Microsoft.Web.Administration assembly which can be installed using this unofficial nuget package or by adding a reference to this dll %WinDir%\System32\InetSrv

How to setup event log for .NET Core 3.0 Worker Service

限于喜欢 提交于 2019-12-05 10:22:24
I'm working with the new Worker Service app template with .NET Core 3.0 Preview and am trying to add event logging using the AddEventLog method. However, I cannot see any of my logs via the Event Viewer in Windows. I have a very simple Worker app setup and have configured logging in the Program.cs file as follows: public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .UseWindowsService() .ConfigureLogging((context, logging) => { logging.AddEventLog(new EventLogSettings() { SourceName = "MyTestSource", LogName = "MyTestLog" }); }) .ConfigureServices(

How to detect if the environment is staging or production in azure hosted service worker role?

荒凉一梦 提交于 2019-12-05 08:05:17
I have a worker role in my hosted service. The worker is sending e-mail daily bases. But in the hosted service, there are 2 environment, Staging and Production. So my worker role sends e-mail 2 times everyday. I'd like to know how to detect if the worker is in stagning or production. Thanks in advance. Anže Vodovnik As per my question here , you'll see that there is no fast way of doing this. Also, unless you really know what you are doing, I strongly suggest you not do this . However, if you want to, you can use a really nice library ( Azure Service Management via C# ) although we did have

Rails Resque undefined method error in external module

六月ゝ 毕业季﹏ 提交于 2019-12-05 04:12:50
I'm having trouble calling methods from an included module inside a resque worker. In the example below, I keep getting undefined method errrors when I attempt to call the say method inside the worker (which is in the TestLib module). I've reduced the code down to bare basics to illustrate the issue: Controller (/app/controllers/test_controller.rb) class TestController < ApplicationController def testque Resque.enqueue( TestWorker, "HI" ) end end Library (/lib/test_lib.rb) module TestLib def say( word ) puts word end end Worker (/workers/test_worker.rb) require 'test_lib' class TestWorker

【storm集群】storm 工作目录不停生成hs_err_pidXXX.log

a 夏天 提交于 2019-12-05 00:56:36
昨天搭建好集群,提交了topology,但是始终没有结果。今天debug一天终于解决了,记录下来。 问题描述:## ui显示topology在运行,但是emit, uptime等数据始终为0。 jps没有发现worker进程,看 supervisor.log 和 worker-*.log,发现supervisor一直在启动worker进程, 但是worker马上就死了 工作目录不停产生hs_err_pidXXX.log日志。 解决过程: 开始怀疑代码有问题,在本地模式下调试,确实发现问题,但是解决完问题成功在本地运行后,在集群上还是一样 看到很多hs_err_pidXXX.log,在网上查了下是jvm崩溃了,因为对java了解不深,以为是java版本问题(集群机器上有1.6 1.7 两个版本)。于是将集群的机器都改成 1.6。结果还是有问题 反复看各种storm日志,google, 改代码,重新跑topology, 重启集群,以root身份启动集群....... 结果都失败了 回头找了下介绍hs_err_pidXXX.log,定位了问题(不能确定) 从文件头部信息看来,是 libzmq这个库的问题。运维安装的是最新稳定版的zeromq 和 jzmq。 在两者兼容性问题上纠结了半天,网上查了很多博客资料,依旧搞不出个所以然。 无意中看到storm出 0.9 了

How can l launch each worker in a multiprocessing.Pool in a new shell?

梦想的初衷 提交于 2019-12-04 19:20:46
I'm trying to couple the execution of a spawned process in a worker pool to a new system terminal. In the following example (adapted from @sylvain-leroux's answer to this question) a pool of workers is constructed to do some work with queued objects. import os import time import multiprocessing # A main function, to be run by our workers. def worker_main(queue): print('The worker at', os.getpid(), 'is initialized.') while True: # Block until something is in the queue. item = queue.get(True) print(item) time.sleep(0.5) if __name__ == '__main__': # Instantiate a Queue for communication. the

Update progress bar and multiple labels from thread

末鹿安然 提交于 2019-12-04 14:52:52
I'm working on a JavaFX application that let's the user select a folder and then parse it's contents to find MP3 files and read their metadata. I got this working with Swing although I found it hard to make the user interface look good. Thus I'm trying to do the same in JavaFX. In the original Swing app, I create a thread which starts the parsing of files in the folder the user selected. It works like this: Find out total number of files to parse - The number of files and the number of folders are continuously presented in two separate labels in the UI Parse all files to find which ones are

How to get the current list of Worker Request from IIS using C#?

江枫思渺然 提交于 2019-12-04 11:55:09
I am writing the code for a RESTful web service status page. I was wondering if there is away to get the current request from IIS into C#. I am using IIS 7.0 and the info I want is under IIS > Worker procecces > ASP.NET v4.0 > Requests You can use the GetRequests method of the WorkerProcess type. This type is located in the Microsoft.Web.Administration assembly which can be installed using this unofficial nuget package or by adding a reference to this dll %WinDir%\System32\InetSrv\Microsoft.Web.Administration.dll Exemple : using (ServerManager manager = new ServerManager()) { while (true) {