Skip to content

ProfileLookUp Methods

Sai Gopal edited this page Aug 30, 2015 · 3 revisions

ProfileLookup Methods Wiki

Note : The profile returned by any lookup type is lowercased always.

  • ProfileLookupMethod = 'None'

    • This Lookup type returns the profile for any key as 'default'

    • To use this as the ProfileLookupMethod , in ratelimitd.conf please set "ProfileLookupMethod: None"

    • You can use this to have the same 'profile' for all keys and apply the same rate limits for everyone

  • ProfileLookupMethod = 'HTTP/HTTPS'

    • This Lookup type performs a http/https get request to the url mentioned and expects the only the profile of the key returned

    • To use this as the ProfileLookupMethod , in ratelimitd.conf please set "ProfileLookupMethod: HTTPUri" eg: "http://localhost:8000?ip=%s"

    • Any '%s' is replaced with the key under the profile before making the call

    • The profile of the key is cached in redis as determined by the ProfileCacheTime in secs.[Set to '0'(zero) to disable the cache]

  • ProfileLookupMethod = 'Hash'

    • This Lookup type opens a hash format Berkeley DB and looks up the key and excepts its value as the profile

    • To use this as the ProfileLookupMethod , in ratelimitd.conf please set "ProfileLookupMethod: hash:///absolute/path/to/file" eg: "hash:///opt/ratelimitd/etc/example.db"

    • The profile of the key is cached in redis as determined by the ProfileCacheTime in secs.[Set to '0'(zero) to disable the cache]

  • ProfileLookupMethod = 'Postgresql'

    • This Lookup type connects to a postgresql instance and performs the query configured and expects the only the profile of the key returned

    • To use this as the ProfileLookupMethod , in ratelimitd.conf please set "ProfileLookupMethod: Postgresql URI" eg: "postgresql://user@hostname/db"

    • Also set "ProfileLookupQuery: Valid Postgresql query terminated by a semi-colon(;)" . Any '%s' is replaced with the key under the profile before making the query.[You can even call user defined functions]

    • The profile of the key is cached in redis as determined by the ProfileCacheTime in secs.[Set to '0'(zero) to disable the cache]