-
Notifications
You must be signed in to change notification settings - Fork 22
RDK-60476: Reduce default connection pool size to 1 #260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 5 commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
0c905b2
RDK-60476: Update L1 and L2 testcases for fork elimination
yogeswaransky 1de72ea
RDK-60476: Update L1 and L2 testcases for fork elimination
yogeswaransky 308f165
RDK-60476: Update L1 and L2 testcases for fork elimination
yogeswaransky 7e4161c
RDK-60476: Update L1 and L2 testcases for fork elimination
yogeswaransky e5830f2
RDK-60476: Update L1 and L2 testcases for fork elimination
yogeswaransky 33b954c
RDK-60476: Update L1 and L2 testcases for fork elimination
yogeswaransky 2e8c436
RDK-60476: Update L1 and L2 testcases for fork elimination
yogeswaransky bbae086
RDK-60476: Update L1 and L2 testcases for fork elimination
yogeswaransky 441fa38
RDK-60476: Update L1 and L2 testcases for fork elimination
yogeswaransky 10af6b8
RDK-60476: Update L1 and L2 testcases for fork elimination
yogeswaransky ee02b0e
RDK-60476: Update L1 and L2 testcases for fork elimination
yogeswaransky 00aac3d
RDK-60476: Update L1 testcases for fork elimination
yogeswaransky 93d8643
RDK-60476: Update L1 testcases for fork elimination
yogeswaransky f18d825
RDK-60476: Update L1 and L2 testcases for fork elimination
yogeswaransky 95a0866
RDK-60476: Update L1 and L2 testcases for fork elimination
yogeswaransky ca3332e
RDK-60476: Update L1 testcases for fork elimination
yogeswaransky 87dbeb0
RDK-60476: Update L1 testcases for fork elimination
yogeswaransky c47578c
RDK-60476: Update L1 and L2 testcases for fork elimination
yogeswaransky 2a05bdb
RDK-60476: Update L1 and L2 testcases for fork elimination
yogeswaransky 4944d6c
RDK-60476: Update L1 and L2 testcases for fork elimination
yogeswaransky 3b3c9f9
RDK-60476: Update L1 and L2 testcases for fork elimination
yogeswaransky ce59899
RDK-60476: Update L1 and L2 testcases for fork elimination
yogeswaransky f438b62
RDK-60476: Update L1 and L2 testcases for fork elimination
yogeswaransky f9b0a20
RDK-60476: Update L1 and L2 testcases for fork elimination
yogeswaransky 6aab5c4
RDK-60476: Update L1 and L2 testcases for fork elimination
yogeswaransky 24f8c4c
Merge branch 'topic/RDK-60476' of https://github.com/rdkcentral/telem…
yogeswaransky df83611
RDK-60476: Update L1 and L2 testcases for fork elimination
yogeswaransky cef5a34
RDK-60476: Update L1 and L2 testcases for fork elimination
yogeswaransky 2d82850
RDK-60476: Update L1 and L2 testcases for fork elimination
yogeswaransky 839cd93
RDK-60476: Update L1 and L2 testcases for fork elimination
yogeswaransky 2611f12
RDK-60476: Update L1 and L2 testcases for fork elimination
yogeswaransky 7420d45
RDK-60476: Create xconf-dcm-response.json
yogeswaransky 3e9e720
RDK-60476: Update L2-tests.yml
yogeswaransky 82172ba
Merge pull request #273 from rdkcentral/develop
yogeswaransky d1970b7
RDK-60476: Update L1 and L2 testcases for fork elimination
yogeswaransky 20c01ec
RDK-60488: Delete test/test-artifacts/mockxconf/xconf-dcm-response.json
yogeswaransky 7eceb14
RDK-60488: Delete test/test-artifacts/mockxconf/xconf-dcm-response2.json
yogeswaransky 13013fb
RDK-60476: Update L1 and L2 testcases for fork elimination
yogeswaransky 68f8375
Merge branch 'topic/RDK-60476' of https://github.com/rdkcentral/telem…
yogeswaransky dd81303
RDK-60476: Update L1 and L2 testcases for fork elimination
yogeswaransky b4def74
Adding design diagrams and flow diagrams for easy understanding
shibu-kv 7baf0a9
RDK-60476: Update L1 and L2 testcases for fork elimination
yogeswaransky 482172e
Merge branch 'topic/RDK-60476' of https://github.com/rdkcentral/telem…
yogeswaransky dd224b6
RDK-60476: Update L1 and L2 testcases for fork elimination
yogeswaransky File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,227 @@ | ||
| # Curl Memory Leak Test - Device Integration | ||
|
|
||
| ## Overview | ||
| This memory leak detection tool is now integrated with the main telemetry build system and will be compiled as `curl_leak_test` alongside `telemetry2_0` for device deployment. | ||
|
|
||
| ## Building with Telemetry | ||
|
|
||
| ### 1. Standard Telemetry Build Process | ||
| ```bash | ||
| # Navigate to telemetry root directory | ||
| cd c:\Users\yk185\docker\60476\telemetry | ||
yogeswaransky marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
yogeswaransky marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| # Standard autotools build (this will now include curl_leak_test) | ||
| ./configure [your_normal_telemetry_configure_flags] | ||
| make | ||
| make install | ||
| ``` | ||
|
|
||
| ### 2. Build Output | ||
| After building, you'll have both binaries: | ||
| - `/usr/bin/telemetry2_0` - Main telemetry daemon | ||
| - `/usr/bin/curl_leak_test` - Memory leak detection tool | ||
|
|
||
| ### 3. Configure Flags for curl_leak_test | ||
| The tool automatically inherits all telemetry build flags: | ||
|
|
||
| ```bash | ||
| # Basic build | ||
| ./configure | ||
|
|
||
| # With mTLS support | ||
| ./configure --enable-rdkcertsel | ||
|
|
||
| # With RDKB support | ||
| ./configure --enable-rdkb-support | ||
|
|
||
| # With RDK logging | ||
| ./configure --enable-rdklogger | ||
|
|
||
| # Full featured build | ||
| ./configure --enable-rdkcertsel --enable-rdkb-support --enable-rdklogger | ||
| ``` | ||
|
|
||
| ## Device Deployment | ||
|
|
||
| ### 1. Install on Device | ||
| ```bash | ||
| # Copy to device (same as telemetry2_0) | ||
| scp curl_leak_test root@device_ip:/usr/bin/ | ||
| chmod +x /usr/bin/curl_leak_test | ||
| ``` | ||
|
|
||
| ### 2. Run on Device | ||
| ```bash | ||
| # Basic test (10 iterations, 2 second intervals) | ||
| curl_leak_test 10 2 | ||
|
|
||
| # Continuous monitoring (infinite iterations) | ||
| curl_leak_test 0 5 | ||
|
|
||
| # Quick test (5 iterations, 1 second intervals) | ||
| curl_leak_test 5 1 | ||
|
|
||
| # Background monitoring with logging | ||
| nohup curl_leak_test 100 10 > /tmp/curl_leak_test.log 2>&1 & | ||
| ``` | ||
|
|
||
| ### 3. Device-Specific Usage | ||
|
|
||
| #### Check Device Connectivity First | ||
| ```bash | ||
| # Test basic connectivity before running curl_leak_test | ||
| ping -c 3 8.8.8.8 | ||
| curl -v https://httpbin.org/get | ||
|
|
||
| # If external connectivity fails, modify test URLs in source | ||
| ``` | ||
|
|
||
| #### Monitor Device Resources | ||
| ```bash | ||
| # Monitor while test runs | ||
| watch -n 5 "ps aux | grep curl_leak_test; echo; cat /proc/meminfo | head -5" | ||
|
|
||
| # Check for memory growth patterns | ||
| tail -f /proc/`pgrep curl_leak_test`/status | grep -E "(VmRSS|VmSize)" | ||
| ``` | ||
|
|
||
| ## Integration Benefits | ||
|
|
||
| ### 1. Same Build Environment | ||
| - Uses exact same compiler flags as telemetry2_0 | ||
| - Links against same libraries (libhttp.la, libxconfclient.la) | ||
| - Inherits all conditional compilation flags | ||
| - No version mismatches | ||
|
|
||
| ### 2. Real mTLS Testing | ||
| - When built with `--enable-rdkcertsel`, tests actual mTLS implementation | ||
| - Uses device certificates and configuration | ||
| - Tests real-world authentication scenarios | ||
|
|
||
| ### 3. Device Network Environment | ||
| - Tests in actual device network conditions | ||
| - Uses device DNS, routing, firewall rules | ||
| - Tests with device-specific SSL/TLS configuration | ||
|
|
||
| ## Memory Leak Analysis on Device | ||
|
|
||
| ### 1. Expected Output on Device | ||
| ``` | ||
| === Curl Memory Leak Test Application === | ||
| Using max iterations: 10 | ||
| Using interval: 2 seconds | ||
|
|
||
| Initial memory usage: | ||
| VmSize: 5432 kB | VmRSS: 2345 kB | ||
|
|
||
| [Iteration 1] Testing HTTP POST... | ||
| [DEBUG] http_pool_post ; POST url = https://httpbin.org/post | ||
| [Iteration 1] POST request successful | ||
|
|
||
| --- Memory Usage at iteration 5 --- | ||
| VmSize: 5438 kB | VmRSS: 2347 kB | ||
|
|
||
| === Memory Usage Summary === | ||
| Initial - VmSize: 5432 kB | VmRSS: 2345 kB | ||
| Peak - VmSize: 5441 kB | VmRSS: 2350 kB | ||
| Final - VmSize: 5439 kB | VmRSS: 2348 kB | ||
| Growth - VmSize: +7 kB | VmRSS: +3 kB | ||
|
|
||
| ✓ Memory usage appears stable (growth: 3 kB) | ||
| ``` | ||
|
|
||
| ### 2. Interpreting Device Results | ||
| - **Growth < 50KB**: Normal for device environment | ||
| - **Growth 50-500KB**: Monitor across multiple test runs | ||
| - **Growth > 500KB**: Investigate potential leak | ||
| - **Consistent growth pattern**: Likely memory leak | ||
|
|
||
| ### 3. Device Debugging Commands | ||
| ```bash | ||
| # Real-time memory monitoring | ||
| watch -n 2 "grep -E 'VmRSS|VmSize' /proc/\`pgrep curl_leak_test\`/status" | ||
|
|
||
| # Check for memory fragments | ||
| cat /proc/`pgrep curl_leak_test`/smaps | grep -E "(Rss|Pss|Private)" | ||
|
|
||
| # Monitor network connections | ||
| netstat -tupln | grep curl_leak_test | ||
|
|
||
| # Check file descriptors | ||
| ls -la /proc/`pgrep curl_leak_test`/fd/ | wc -l | ||
| ``` | ||
|
|
||
| ## Troubleshooting on Device | ||
|
|
||
| ### 1. Build Issues | ||
| ```bash | ||
| # If build fails, check autotools regeneration | ||
| autoreconf -fiv | ||
| ./configure [flags] | ||
| make clean && make | ||
| ``` | ||
|
|
||
| ### 2. Network Issues on Device | ||
| ```bash | ||
| # Test basic device connectivity | ||
| ping -c 3 8.8.8.8 | ||
| nslookup httpbin.org | ||
|
|
||
| # Check device firewall | ||
| iptables -L | grep OUTPUT | ||
|
|
||
| # Test with local URLs if external blocked | ||
| # Modify TEST_URL in source to use local server | ||
| ``` | ||
|
|
||
| ### 3. Permission Issues | ||
| ```bash | ||
| # Ensure proper permissions | ||
| chmod +x /usr/bin/curl_leak_test | ||
| chown root:root /usr/bin/curl_leak_test | ||
| ``` | ||
|
|
||
| ## Customization for Device Environment | ||
|
|
||
| ### 1. Modify Test URLs for Internal Testing | ||
| ```c | ||
| // In curl_leak_test.c, change these for device-specific endpoints | ||
| #define TEST_URL "http://internal-server:8080/post" | ||
| #define TEST_GET_URL "http://internal-server:8080/get" | ||
| ``` | ||
|
|
||
| ### 2. Device-Specific Configuration | ||
| ```bash | ||
| # Set device-specific environment variables | ||
| export T2_CONNECTION_POOL_SIZE=1 # For resource-constrained devices | ||
| export CURL_CA_BUNDLE=/etc/ssl/certs/ca-bundle.crt | ||
| ``` | ||
|
|
||
| ### 3. Integration with Device Scripts | ||
| ```bash | ||
| #!/bin/bash | ||
| # Device monitoring script | ||
| ITERATIONS=50 | ||
| INTERVAL=10 | ||
| LOG_FILE="/tmp/memory_leak_$(date +%Y%m%d_%H%M%S).log" | ||
|
|
||
| echo "Starting curl memory leak test on device" | ||
| curl_leak_test $ITERATIONS $INTERVAL > $LOG_FILE 2>&1 | ||
|
|
||
| # Analyze results | ||
| GROWTH=$(grep "Growth.*VmRSS:" $LOG_FILE | tail -1 | awk '{print $6}' | sed 's/[+kB]//g') | ||
| if [ "$GROWTH" -gt 100 ]; then | ||
| echo "WARNING: Memory growth detected: ${GROWTH}kB" | ||
| # Send alert or upload log | ||
| fi | ||
| ``` | ||
|
|
||
| ## Continuous Integration | ||
|
|
||
| The tool is now part of the telemetry build pipeline, so: | ||
| - It builds automatically with telemetry CI/CD | ||
| - Uses same build flags and environment | ||
| - Can be deployed alongside telemetry updates | ||
| - Maintains version synchronization | ||
|
|
||
| This integration ensures your memory leak testing tool is always available on devices and stays in sync with the telemetry implementation it's testing. | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.