Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I'm running into an issue with the Power BI On-Premises Data Gateway installed on an AWS EC2 instance (Windows Server). I've developed a custom connector and configured it correctly using the standard steps, placing the .mez file in the appropriate Custom Connectors folder and updating the gateway settings.
Everything works fine initially. The connector is detected and I can refresh the dataset from the Power BI Fabric. However, the issue occurs for schedule refreshes — after some refreshes , the refresh fails and the Power BI Service shows that the gateway is offline or can't connect.
I logged into the EC2 instance and noticed that the gateway service (PBIEgwService) has stopped running. Restarting the service manually and re-adding the connector path resolves it temporarily, but the issue keeps recurring.
Solved! Go to Solution.
Hi @Vishnu_G ,
Thank you for reaching out to Microsoft Fabric Community Forum.
$service = Get-Service -Name "PBIEgwService"
if ($service.Status -ne "Running") {
Restart-Service -Name "PBIEgwService" -Force
}
Optimize queries to push data transformations to the source database instead of performing them in Power Query.
Enable gateway diagnostic logging to track CPU/memory spikes and refresh bottlenecks.
Open necessary firewall ports (e.g., 443, 5671, 5672, 9350–9354) to avoid TCP connection errors like 10061.
Set up staggered refresh schedules in Power BI Service to avoid resource spikes during concurrent refreshes.
Configure a daily scheduled task to stop and start the gateway service during off-hours to clear memory and refresh service state.
Keep the On-Premises Gateway updated to the latest version for performance and stability improvements.
Consider configuring a gateway cluster for load balancing and high availability if refresh loads remain high.
Regards,
Chaithanya.
Hi @Vishnu_G
I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.
Thank you.
Hi @Vishnu_G
I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.
Thank you.
Hi @Vishnu_G
I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.
Thank you.
Hi @Vishnu_G ,
Thank you for reaching out to Microsoft Fabric Community Forum.
$service = Get-Service -Name "PBIEgwService"
if ($service.Status -ne "Running") {
Restart-Service -Name "PBIEgwService" -Force
}
Optimize queries to push data transformations to the source database instead of performing them in Power Query.
Enable gateway diagnostic logging to track CPU/memory spikes and refresh bottlenecks.
Open necessary firewall ports (e.g., 443, 5671, 5672, 9350–9354) to avoid TCP connection errors like 10061.
Set up staggered refresh schedules in Power BI Service to avoid resource spikes during concurrent refreshes.
Configure a daily scheduled task to stop and start the gateway service during off-hours to clear memory and refresh service state.
Keep the On-Premises Gateway updated to the latest version for performance and stability improvements.
Consider configuring a gateway cluster for load balancing and high availability if refresh loads remain high.
Regards,
Chaithanya.
Hi @v-kathullac
Thank you for the detailed recommendations.
We are currently running the On-Premises Data Gateway on a t3.large EC2 instance with 50 GB of RAM. However, during scheduled Power BI dashboard refreshes, we consistently observe CPU utilization reaching 100% and memory usage exceeding 90%. This often causes the gateway service to crash or become unresponsive.
In our custom connector, we are using:
bufferedTable = Table.Buffer(finalTable)
We're investigating whether the use of Table.Buffer may be causing excessive memory pressure or inefficient caching, especially when processing large datasets. We'd appreciate any guidance on whether Table.Buffer might be contributing to these issues and if there are best practices for managing memory more efficiently in such scenarios.
Additionally, we are encountering the following error in the gateway logs:
'Microsoft.PowerBI.DataMovement.Pipeline.GatewayClient.GatewayConfigurationClientException: Error retrieving gateway configuration. Please ensure your gateway is running on the local computer and it is updated to the latest version.
Exception message: Could not connect to net.tcp://{port}/powerbi/gatewayconfiguration/service. The connection attempt lasted for a time span of 00:00:02.0224416. TCP error code 10061: No connection could be made because the target machine actively refused it.
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
at System.ServiceModel.Channels.SocketConnectionInitiator.Connect(Uri uri, TimeSpan timeout) '
We have already configured the service recovery options in services.msc to restart the gateway on first, second, and subsequent failures, and we have also configured it to reset the failure count after 1 day. Despite these settings, the gateway service fails to restart automatically when it crashes—requiring manual intervention each time.
This further indicates a potentially critical issue either with how memory and resources are being handled in the custom connector, or with the overall system resource limits under load.
Could this behavior be tied to how our connector is managing in-memory data (e.g., use of Table.Buffer), or are there any other diagnostics or mitigation strategies you would recommend?
Hi @Vishnu_G ,
Thank you for reaching out to Microsoft Fabric Community Forum.
This is a common issue when using custom connectors with Power BI On-Premises Data Gateway on cloud-hosted environments like AWS EC2. Below are few points that can fix the recurring service crash
Regards,
Chaithanya.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
8 | |
3 | |
2 | |
2 |
User | Count |
---|---|
4 | |
3 | |
3 | |
3 | |
2 |