Skip to content
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

I used a tester to test VPN throughput and found that charon’s memory usage was high and was killed by the kernel. Is there any solution to limit memory usage? #2193

Open
LibreBai opened this issue Apr 2, 2024 · 13 comments
Labels

Comments

@LibreBai
Copy link

LibreBai commented Apr 2, 2024

System (please complete the following information):

  • OS: centos7
  • Kernel version (if applicable): [3.10]
  • strongSwan version(s): [5.8.1]
  • Tested/confirmed with the latest version: [no]

Describe the bug
I used a tester to test VPN throughput and found that charon’s memory usage was high and was killed by the kernel. Is there any solution to limit memory usage?

@tobiasbrunner
Copy link
Member

Please provide a lot more information.

@LibreBai
Copy link
Author

LibreBai commented Apr 3, 2024

@tobiasbrunner Thank you for your reply.

According to the test feedback from my classmates, the memory of the charon process will occupy more than 6G and then be killed. I am not sure whether this is a memory leak or the memory occupied by normal business. If you can determine that this is abnormal memory usage, I can retest and display all configurations and memory records in detail.

@tobiasbrunner
Copy link
Member

If you can determine that this is abnormal memory usage, I can retest and display all configurations and memory records in detail.

Well, how could I determine that without knowing what you actually did? You haven't provided any information at all (config, logs etc.) or details on what that "tester" did. Also, what does "VPN throughput" mean? Because strongSwan is an IKE daemon, it does not usually handle IPsec traffic.

@LibreBai
Copy link
Author

LibreBai commented Apr 7, 2024

I will provide complete information for you to judge later. The current situation is that, as shown in the red box in the picture, this process occupies more than 6G of memory, is directly killed by the kernel kill -9, and will always restart.

@LibreBai
Copy link
Author

LibreBai commented Apr 7, 2024

image

@LibreBai
Copy link
Author

LibreBai commented Apr 7, 2024

The configuration is shown in the figure below. The two subnets are 2.1.1.0 and 3.1.1.0.
image
image

The picture below shows the memory usage, which is growing very fast.It takes about 20 seconds to reach 6G.

The data packets passing through the VPN tunnel are UDP, with 100 source IPs and 100 destination IPs respectively, and there may be up to 10,000 sessions.

At the same time, there are also memory usage and other related prompts in demsg.
image
image

If you need more information, please reply directly. There is currently a relevant test environment.

@LibreBai
Copy link
Author

LibreBai commented Apr 7, 2024

image

@tobiasbrunner
Copy link
Member

I can't read the stuff in some of these images. Anyway, as I said before, strongSwan does not generally handle IPsec traffic (or get affected by it). So the question is: are you using kernel-libipsec? If so, don't!

@LibreBai
Copy link
Author

I understand what you mean, but if the data packet is sent quickly, the charon process will occupy more than 6G of memory and then be killed by the kernel.

@LibreBai
Copy link
Author

This is my configuration with two linux hosts.
image

This is the network port configuration of the two devices.
image

This is after the two devices receive UDP data packets, the charon process will occupy 6G of memory in 20 seconds.
image

This is the error message reported by demsg.
image

The kernel-libipsec related options were indeed enabled during compilation. I will test again.

@LibreBai
Copy link
Author

I didn't use the --enable-kernel-libipsec parameter during compilation, but the charon process was still killed due to memory usage reaching 6GB. I'll try using a new version.

@tobiasbrunner
Copy link
Member

That doubt this has anything to do with the version. Did you make sure that everything from the previous installation was removed?

@LibreBai
Copy link
Author

I will conduct the first test using CentOS 7 with version 5.7.2, and then proceed with the second test using CentOS Stream with the latest version of StrongSwan. Please await my update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants