Skip to content

Conversation

@fatelei
Copy link
Contributor

@fatelei fatelei commented Dec 25, 2025

Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

fix #29642

Performance Optimization Configuration

  1. Connection Limits
  • max_filedescriptors 65536 - Support more concurrent connections
  • maximum_tcp_connections 1000 - Maximum TCP connections
  1. Timeout Configuration (optimized for image requests)
  • connect_timeout 2 minutes - Connection timeout
  • request_timeout 10 minutes - Request timeout (sufficient for large image downloads)
  • read_timeout 10 minutes - Read timeout
  • client_lifetime 24 hours - Client connection keep-alive time
  1. Connection Reuse (improve performance)
  • server_persistent_connections on - Server-side persistent connections
  • client_persistent_connections on - Client-side persistent connections
  • persistent_request_after_timeout 30 seconds - Reuse connections after timeout
  1. Request Protection
  • quick_abort_min/max/pct - Prevent near-completion requests from being interrupted
  • client_idle_pconn_timeout - Idle connection timeout
  1. Memory Cache
  • cache_mem 256 MB - Memory cache size
  • maximum_object_size_in_memory 512 KB - Suitable for small icons/avatars
  1. DNS Optimization
  • dns_nameservers 8.8.8.8 8.8.4.4 - Use public DNS servers
  • dns_timeout 30 seconds - DNS timeout

These configurations should significantly improve timeout issues when handling high-concurrency image requests. You need to restart the squid service for the changes to take effect.

Screenshots

Before After
... ...

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods

@gemini-code-assist
Copy link
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. 💪 enhancement New feature or request labels Dec 25, 2025
@crazywoola crazywoola requested a review from Copilot December 25, 2025 08:27
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the Squid proxy configuration to address timeout issues with high-concurrency image requests by adding comprehensive performance optimization settings including connection management, timeout configurations, persistent connections, and caching improvements.

Key Changes:

  • Added extensive timeout configurations (connect, request, read) optimized for image handling
  • Enabled persistent connections for both server and client sides with connection pooling
  • Configured memory caching with 256 MB allocation and DNS optimization with public resolvers

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 4, 2026
@crazywoola crazywoola merged commit 9673614 into langgenius:main Jan 4, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💪 enhancement New feature or request lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The readoperation timed outNo files were successfully processed

2 participants