This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

HTTP Proxy and CFFS (Categorization Servers) slowdown

I spent some time today to experiment with the Astaro Proxy server, looking for why the feeling of web browsing snappiness is gone when using astaro. As many pointed out it has to do with Astaro Categorization servers (CFFS).

I setup a SafeSquid Proxy, with URL filtering (just like astaro), and according to my test, Browsing with safesquid it twice faster than with Astaro, for example a page would take 3 sec to load took between 6 and 10 seconds to load with astaro. A 2 sec page took 4 sec with astaro. This is with a single user.

The wrose is this was with all security feature of the proxy turned OFF, (AV, URL filter etc)

I`ve also set my safesquid as a parent proxy for astaro to see what it does.  Basically even if you turn off all Astaro proxy feature, it still make 1 connection to its CFFS server for each request that the proxy process.

Over a few minutes, Astaro make 7316 request to its CFFSXX.astaro.com server!!

Now, what happen if you block thoses. I blocked the cffs server in the squid proxy, and things only gets wrose.. Page are even slower to load when using the Astaro proxy because all its connection to cffs server time out.. (See log below)

Finally, my ping to my closest cffs is not bad, so imagine how bad this gets for user with very high ping to the best of the cffs server list.

My ping is currently reported at 85 in the proxy log, and about 40 when using ping.

So basically, I believe there is a great area for improvement there. 

1) Why does Astaro still look for categoriezation even if all Feature of the proxy are turned off (including all URL filter), even if a host is white listed ???????????? This makes no sense to me
2) Why are the categorization not cached for some time? Currently it seem that 1Request = 1CFFS Request
3) Local replication would definatly be lightning fast, but probably have issues assosiated with.


This is what happen when you block all cffs(even if URL filtering if OFF), and start using the proxy:

2010:09:20-20:15:21 plasmashield httpproxy[651]: id="0003" severity="info" sys="SecureWeb" sub="http" request="0xf1850878" function="sc_categorize_url" file="scr_scanner.c" line="941" message="no categorization received for url: www.nationalpost.com/.../btn-next.gif"
2010:09:20-20:15:21 plasmashield httpproxy[651]: id="0003" severity="info" sys="SecureWeb" sub="http" request="(nil)" function="sc_decrypt" file="scr_scanner.c" line="438" message="EVP_DecryptFinal failed"
2010:09:20-20:15:21 plasmashield httpproxy[651]: id="0003" severity="info" sys="SecureWeb" sub="http" request="(nil)" function="sc_server_cmd" file="scr_scanner.c" line="631" message="cffs04.astaro.com: decrypt failed"
2010:09:20-20:15:21 plasmashield httpproxy[651]: id="0003" severity="info" sys="SecureWeb" sub="http" request="0xd735ae00" function="sc_categorize_url" file="scr_scanner.c" line="941" message="no categorization received for url: www.nationalpost.com/.../comments-logo.gif"
2010:09:20-20:15:22 plasmashield httpproxy[651]: id="0003" severity="info" sys="SecureWeb" sub="http" request="(nil)" function="sc_decrypt" file="scr_scanner.c" line="438" message="EVP_DecryptFinal failed"
2010:09:20-20:15:22 plasmashield httpproxy[651]: id="0003" severity="info" sys="SecureWeb" sub="http" request="(nil)" function="sc_server_cmd" file="scr_scanner.c" line="631" message="cffs03.astaro.com: decrypt failed"
2010:09:20-20:15:22 plasmashield httpproxy[651]: id="0003" severity="info" sys="SecureWeb" sub="http" request="(nil)" function="sc_decrypt" file="scr_scanner.c" line="438" message="EVP_DecryptFinal failed"
2010:09:20-20:15:22 plasmashield httpproxy[651]: id="0003" severity="info" sys="SecureWeb" sub="http" request="(nil)" function="sc_server_cmd" file="scr_scanner.c" line="631" message="cffs07.astaro.com: decrypt failed"
2010:09:20-20:15:22 plasmashield httpproxy[651]: id="0003" severity="info" sys="SecureWeb" sub="http" request="(nil)" function="sc_decrypt" file="scr_scanner.c" line="438" message="EVP_DecryptFinal failed"
2010:09:20-20:15:22 plasmashield httpproxy[651]: id="0003" severity="info" sys="SecureWeb" sub="http" request="(nil)" function="sc_server_cmd" file="scr_scanner.c" line="631" message="cffs06.astaro.com: decrypt failed"
 


So it does look for categorization even if it's not necessary.

Thoses who care about this, should speak: http://feature.astaro.com/forums/17359-astaro-security-gateway-feature-requests/suggestions/178336-websecurity-local-content-filter-database?ref=title


This thread was automatically locked due to age.
  • [FONT=Verdana][SIZE=2]Hi,

    I'd like to take the time to answer this, for the clarity of operations-sake. To answer your main question, why there are content filter lookups even with URL filtering off, is quite easy. With using JUST the http/s proxy "framework", even with no checks enabled, you are still getting one main benefit, logging and reporting. Reporting means the categories of the sites surfed need to be known, so as such the servers are still consulted where necessary.

    Caching is explained in good depth within the 7.500 release notes, but for your info, where you see cached in the logs, there is a flag which indicates the nature of the hit:
     ·  Cached=0: Object is new and not currently cached, and its nature cannot be handled by the cache for this hit, so it was served directly from the target server. 
    ·  Cached=1: Object is known and cached and has been served to the user via the cache directly.
    ·  Cached=2: Object is known to the cache but was past its server-configured expiry time. Object was revalidated (but not re-downloaded), and since no change was made to the object, it was issued to the user via the cache directly. 
    ·  Cached=4: Object was not present in the cache but it cacheable. As such, the object was downloaded and inserted in the cache while being served to the user.

    So depending on the site and many factors, mileage will vary there. With anything like browsing, the speed slowdown with checking each object (which we do in order to have the best and most accurate classification, vs. an inferior solution which would just check the main page url and not all of its objects which are rendered as part of it), the main speed factor will be the distance to the server, the ping to the closest CFF server, and the amount of objects. From there it is just simple math. A large site with many objects, how long each object is fetched by the users browser/Astaro, and a delay of 80milliseconds all times'd together can add up. Further, different browsers will have HUGE differences in how fast they can render a site purely by their architecture.

    However we DO indeed plan to offer a local download/copy of the categorization database, currently this is roadmapped (and reflected in the feature portal at feature.astaro.com) for 8.200.  It will take a fair amount of RAM, which is still being worked on, probably in the realm of 400-800 megabytes depending on the final implementation, which puts it outside of the lower end appliances reach. However for larger boxes or software installations, especially with the new V8 kernel supporting 64-bits and gargantuan amounts of installed memory, it will provide an alternative.


    Thanks a lot for your feedback, hopefully that answers some of your questions!
     
     
    [/SIZE][/FONT]
  • ageloc...when i hit this issue the us based cff server just nearly dies and failing over to overseas is just not good...traces to it nearly fail completely.  I've been talking about this for a looooong time and i even said this was going to become a problem.  Ram requirements?  Don't try to stuff it all into ram.. you have a postgres instance...leverage that mega database..[[:)]]  Some ram caching will help(unless you are talking about the index being 800 megs)..then it's necessary.  Maybe once you folks deploy this i can start digging around and see what kind of improvements i can find..  I'm glad Astaro is finally doing this..[[:)]]

    Owner:  Emmanuel Technology Consulting

    http://etc-md.com

    Former Sophos SG(Astaro) advocate/researcher/Silver Partner

    PfSense w/Suricata, ntopng, 

    Other addons to follow

  • [FONT=Verdana][SIZE=2]Hi,

    I'd like to take the time to answer this, for the clarity of operations-sake. To answer your main question, why there are content filter lookups even with URL filtering off, is quite easy. With using JUST the http/s proxy "framework", even with no checks enabled, you are still getting one main benefit, logging and reporting. Reporting means the categories of the sites surfed need to be known, so as such the servers are still consulted where necessary.

    Caching is explained in good depth within the 7.500 release notes, but for your info, where you see cached in the logs, there is a flag which indicates the nature of the hit:
     ·  Cached=0: Object is new and not currently cached, and its nature cannot be handled by the cache for this hit, so it was served directly from the target server. 
    ·  Cached=1: Object is known and cached and has been served to the user via the cache directly.
    ·  Cached=2: Object is known to the cache but was past its server-configured expiry time. Object was revalidated (but not re-downloaded), and since no change was made to the object, it was issued to the user via the cache directly. 
    ·  Cached=4: Object was not present in the cache but it cacheable. As such, the object was downloaded and inserted in the cache while being served to the user.

    So depending on the site and many factors, mileage will vary there. With anything like browsing, the speed slowdown with checking each object (which we do in order to have the best and most accurate classification, vs. an inferior solution which would just check the main page url and not all of its objects which are rendered as part of it), the main speed factor will be the distance to the server, the ping to the closest CFF server, and the amount of objects. From there it is just simple math. A large site with many objects, how long each object is fetched by the users browser/Astaro, and a delay of 80milliseconds all times'd together can add up. Further, different browsers will have HUGE differences in how fast they can render a site purely by their architecture.

    However we DO indeed plan to offer a local download/copy of the categorization database, currently this is roadmapped (and reflected in the feature portal at feature.astaro.com) for 8.200.  It will take a fair amount of RAM, which is still being worked on, probably in the realm of 400-800 megabytes depending on the final implementation, which puts it outside of the lower end appliances reach. However for larger boxes or software installations, especially with the new V8 kernel supporting 64-bits and gargantuan amounts of installed memory, it will provide an alternative.


    Thanks a lot for your feedback, hopefully that answers some of your questions!
     
     
    [/SIZE][/FONT]


    That's great news Angelo!

    CTO, Convergent Information Security Solutions, LLC

    https://www.convergesecurity.com

    Advice given as posted on this forum does not construe a support relationship or other relationship with Convergent Information Security Solutions, LLC or its subsidiaries.  Use the advice given at your own risk.

  • Indeed!

    Btw, I am sure Astaro do their best to keep their focus where it matters, Security. But I felt like that area was a big drawback to performance, and it was something that could be improved [[[:)]]]

    I am testing Beta since v7.0 and so far, I am quite impressed by the quality and feature set

    This new "local caching" features, coming "hopefully" in 8.2 will be well welcomed and should produce quite a boost in performance for the proxy especially for large entreprise (I am only a picky Home user).

    This stuff is very welcome in my Ram, which is quite under used right now [[[:)]]]

    Thanks for the feedback! [[[:)]]]
  • What I don't understand is why the proxy waits for the answer from the cffs before requesting the content.  Why not ask for both at the same time?

    Cheers - Bob
     
    Sophos UTM Community Moderator
    Sophos Certified Architect - UTM
    Sophos Certified Engineer - XG
    Gold Solution Partner since 2005
    MediaSoft, Inc. USA


  • However we DO indeed plan to offer a local download/copy of the categorization database, currently this is roadmapped (and reflected in the feature portal at feature.astaro.com) for 8.200.  It will take a fair amount of RAM, which is still being worked on, probably in the realm of 400-800 megabytes depending on the final implementation, which puts it outside of the lower end appliances reach. However for larger boxes or software installations, especially with the new V8 kernel supporting 64-bits and gargantuan amounts of installed memory, it will provide an alternative.


    I know I am still a newbie here at Astaro, but I have been Architecting Enterprise IT solutions for the past 20 years.  I would believe the solution is quite simple and would work for all ASG models, even those with only 1GB RAM.  It would seem that the best solution would be to make the handling of the the Cat DB configureable by the ASG admin with the following options (in no particular order);

    * have an enable/disable Cat DB download feature (like all the other ASG options)
    * if enabled, download the entire Cat DB to local DB on disk (as has been suggested)
    * refresh the Cat DB on a periodic basis (whatever is needed) (may want to consider only refreshing updates and not the entire DB at each period)
    * option to load the entire DB into RAM (for performance & for those with at least 2GB) or 'on demand' (to conserve memory & for those with only 1GB)
    * refresh entries in memory when the local Cat DB is updated

    The 'on demand' feature would be to keep the Cat entries for the Top XX sites in memory.  I'm not an expert on internet usage, but it would seem to me that there are three tiers for site visits by users; 1) the frequent ones that are visited on a regular basis 2) the infrequent ones that are only visited occasionally 3) all others sites.  Therefore why not keep the first tier in memory all the time so users do not perceive any slowdown in internet access for those frequently accessed sites.

    That's my .02 cents, thanx for listening.
  • What I don't understand is why the proxy waits for the answer from the cffs before requesting the content.  Why not ask for both at the same time?

    Cheers - Bob


    This is one of the many optimization that could be done. (I haven't though of that one, but seem pretty good one since MOST request will be allowed, so a small amout of content would be downloaded and then denied).

    There are other stuff that could be optimized too, for example it seem that each HTTP Request generate a CFFS query, and each query Open and close a connection.

    I have looked at the traffic and it look like this:
    Request:
    SYN, 
    SYN,ACK
    ACK,
    POST /
    REQUEST

    Response:
    HTTP 200 
    RESPONSE
    Connection: close
    FIN,
    FIN,ACK
    ACK


    Keeping the connection open for a longer period of time would increase performance, (Just like HTTP 1.0 vs HTTP 1.1).

    But local DB would still be the ultimate solution, and might render other optimization like this one useless (on ASG with enough ram to take it).

    This is just an idea. There probably are other optimization that would make a more significant difference. You guys are the pros [:)]
  • Thanks, John, it's good to have another OF around here!  I like your ideas about avoiding the necessity to upgrade RAM; none of my 120/220 customers would appreciate being forced to upgrade.  I don't understand why this couldn't be just another PostgreSQL database.

    X-cimo, that's a great observation, and a simple way to speed things up in the next release instead of waiting for a major version change.  I wonder if that might not tax the Astaro servers though as they would have a lot more connections open simultaneously.

    Back to my suggestion... According to AngeloC, there already is a period where the information is cached, so a simple solution would be:

    URL cached? Block if indicated
    Request URL
    Request categorization of URL if not cached
    Drop or deliver response to URL request


    I don't know how "deep" into the URL TrustedSource goes; maybe the engine considers the entire URL, so every request the Proxy receives must be checked, as there are no duplicate requests.

    Also, Astaro could "smarten" the stardard HTTP cacheing; if an item is in the cache, use it without consulting TrustedSource (or just ignore the response).  If a "block" results from a request to TrustedSource, remove the item from the HTTP cache.

    Anyway, I think we're coming up with "low-cost" suggestions here that could make a substantial difference in responsiveness.

    Cheers - Bob
     
    Sophos UTM Community Moderator
    Sophos Certified Architect - UTM
    Sophos Certified Engineer - XG
    Gold Solution Partner since 2005
    MediaSoft, Inc. USA
  • Hi

    I read the above technical details several times and to the best of my understanding,

    The Slowness is because first it query the CFF Servers, then it Fetch the actual Contents.

    But I still do not understand, why the query to CFF Servers is that slow as in due to the location of the servers thus network latency or the servers are simply overloaded thus the slow response?

    As noted in my other post, I did the traceroutes to all the servers and the results look resonable at about 300 - 400 ms.

    Currently, I switched off the URL Filtering and depend on OpenDNS and to the best of my knowledge, OpenDNS Servers are in US and I am in Singapore and it is simply much better, but of course ideally I would want to use the Astaro ones since it is part of the features.

    As for Local Cache, so far with all features turned on, Double AV, IPS Rules on for all, I used about 1GB out of 2GB, so yeah we can easily afford to load the database into the RAM.
  • Opendns is worldwide..they have a global network of servers using anycast so there's one somewhat near you..much closer than in the US.  I know why the slowdowns occur..i was the first one to post it..i am just using this to document how many times i have to turn off the http proxy to get decent performance...[[:)]]  I've had it off since the previous post..don't know when or if i'll turn it back on...[[:)]]

    Owner:  Emmanuel Technology Consulting

    http://etc-md.com

    Former Sophos SG(Astaro) advocate/researcher/Silver Partner

    PfSense w/Suricata, ntopng, 

    Other addons to follow