Multiple rs.exe invocations

时间:2015-12-08 19:25:37

标签: python python-3.x reporting-services rs.exe

I've a python based SSRS report generation utility that I'm using to generate multiple reports (often 100+). The way it's setup is -

  1. Multiple threads are invoked using threading.Thread and each of them is given a dictionary.
  2. Each thread parses the dictionary and calls rs.exe passing in relevant arguments via python's subprocess.call

Reports get generated with the following caveats -

  1. If there are around 20-30 reports everything works fine without much issues.
  2. If the number of reports go beyond 40-50+ (for reasons unknown to me so far), some of the reports don't get rendered and come back with error as obtained by subprocess.call non-zero status (Error message from subprocess.call does not point to any real error). But there is no error in those rs.exe commands, as they get rendered when i run them from windows command prompt.
  3. Additionally when i try to re-run all those failed reports they get rendered. There's no change in the commands or data while they're being re-run.

To work around this, I employed a retry logic for 2 iterations which seems to fix the issue at times. However when the reports go beyond 100/150+ even the retry doesn't work. Now i could extend the retry logic to keep retrying until all the reports are rendered and whatever failures happen are genuine ones (like RDL not found, corrupted and so on). But before i do any such thing, want to know if there's any limitation on how many rs.exe can be launched simultaneously or if there's any limitation on python's subproces.call when invoked in a multi-threaded context.

Can someone please share their expertise if they've faced this kind of issue and resolved it?

Thanks.

1 个答案:

答案 0 :(得分:0)

我怀疑你遇到的限制不是rs.exe本身,而是目标报表服务器。这将使用尽可能多的物理内存,但是当用尽时,进一步的请求将开始失败。这在SSRS doco中有描述:

https://msdn.microsoft.com/en-us/library/ms159206.aspx

为了避免这个问题并为其他用户留下一些服务器资源,我会尽可能地降低您的线程限制 - 理想情况下为1。