how to parse a value in JMeter sampler result

I want to calculate the response header size and i tried below option but i was unsuccessful.
Option 1: Parse the value returned in Sampler result --> i do not have an inbuilt option.
Option 2: Store the response header in a variable and calculate the length using var.length() function. --> since the response header have new line feeds, the .length function did not work.

Can anyone please suggest me to calculate the response header size in bytes.

I am using Http authorization manager and provided all details like Base URL, user, password, domain, Mechanism (BASIC) , I have parameterized the test with different users login using HTTP auth manager.

We are getting connection timeout for http request after 180 concurrent users are passed? How to handle concurrent users? We are using single login credentials for all 500 users ? Will that effect the flow