简体   繁体   中英

Hangfire on Windows Server 2019 with SQL Server 2019 Express

I'm trying to move to a new hosting provider and I'm having real difficulty getting my web site to run. It uses Hangfire on application startup to run some background jobs, whilst also serving web pages on the main thread.

The website seems to work for the very first page load and then subsequent accesses fail to run a reasonably complex Entity Framework search query.

Here's the server's configuration on the existing machine, via SQL Server's select @@version command:

Microsoft SQL Server 2017 (RTM-GDR) (KB4583456) - 14.0.2037.2 (X64) Nov 2 2020 19:19:59 Copyright (C) 2017 Microsoft Corporation Standard Edition (64-bit) on Windows Server 2016 Standard 10.0 <X64> (Build 14393: )

  • Shared operating system (not sure what this is)
  • SQL Server 2017 - Standard Edition
  • .NET Framework 4.8
  • Hangfire using SQL Server storage, with table's using the Hangfire schema
  • Other application tables, with tables using the dbo schema

Here's the server's configuration on the new machine, via SQL Server's select @@version command:

Microsoft SQL Server 2019 (RTM) - 15.0.2000.5 (X64) Sep 24 2019 13:48:23 Copyright (C) 2019 Microsoft Corporation Express Edition (64-bit) on Windows Server 2019 Standard 10.0 <X64> (Build 17763: ) (Hypervisor)

  • Windows Server 2019
  • SQL Server 2019 - Express edition
  • .NET Framework 4.7,. (according to Plesk, although I've installed 4.8)

On the new server I have full RDP access, so can install whatever software I like on this machine. However, SQL Server Standard edition is extremely expensive for a little website like mine.

Is there something that is preventing the Entity Framework query running on the new Windows Server 2019 machine, with SQL Server Express? Does that combination not allow multiple schemas for the database, or is there some other restriction from this combination that I might not be aware of?

Running the website with SQL Server Express on my local Windows 10 machine runs fine.

I'd really appreciate any help with this, as I'm pulling what little hair I have left out of my head!

Thanks for trying to help, but in the end the problem was a lot simpler than I'd anticipated. I thought this was a permissions issue, but actually it's just a simple performance issue.

Running SQL Express on the new server failed because the machine didn't have enough RAM. It only had 4GB of RAM, and with Plesk and other software installed by the hosting provider, the free RAM was down to just a few hundred MBs.

Some simple queries that would take milliseconds to return on the old server could take over 2 minutes to return on the RAM limited new server.

Increasing the RAM to 8GBs fixed most of the issue, although using SQL Express is still significantly slower than the SQL Standard edition on the old server, and SQL Standard is alarmingly expensive to run just for this one website (the old server has a shared SQL Standard edition installation).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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