Hentai@Home: Difference between revisions

From EHWiki
Jump to navigationJump to search
Yukarin (talk | contribs)
 
(191 intermediate revisions by 13 users not shown)
Line 1: Line 1:
Hentai@Home (H@H) is a Peer-2-Peer gallery distribution system which reduces the load of the [[E-Hentai Galleries]].
Hentai@Home (H@H) is an open-source Peer-2-Peer gallery distribution system which reduces the load on the [[E-Hentai Galleries]]. The current version can be found in the [https://forums.e-hentai.org/index.php?showtopic=234458 update announcement thread].
 
[[Image:H@H Client.png|thumb|The client UI (maximized)]]
[[Image:H@H Client Screen.png|thumb|The client list UI]]


==General Information==
==General Information==
H@H is a project that can be compared to a cross between the [http://setiathome.ssl.berkeley.edu/ SETI@home] project and [http://en.wikipedia.org/wiki/BitTorrent_(protocol) BitTorrent].
H@H is a project that can be compared to a cross between the [https://setiathome.ssl.berkeley.edu/ SETI@home] project and [https://en.wikipedia.org/wiki/BitTorrent_(protocol) BitTorrent].


All participating members run a small Java-based client that downloads files from the main E-Hentai server to their computer and passes the files on to people who browse E-Hentai.org and the [[E-Hentai User Galleries]]. This allows E-Hentai to serve many more files without using vast amounts of costly bandwidth.
All participating users run a small Java-based client that downloads files from the main E-Hentai servers to their computer and passes those files on to people who browse the [[E-Hentai Galleries]]. This allows E-Hentai to serve many more images using less server bandwidth.
 
The client may be run freely for any duration of time but it is recommended to run it continuously for as long as possible for maximum [[#Rewards|rewards]].


==Signing Up==
==Signing Up==
[[Image:H@H Application.png|thumb|The Application screen.]]
[[Image:H@H Application.png|thumb|The H@H application form.]]
===Requirements===
<div id="Requirements"></div><div id="requirements"></div><div id="Requirement"></div><div id="requirement"></div>
(See the [http://forums.e-hentai.org/index.php?showtopic=19795 H@H FAQ topic]).
===Minimum Requirements For New Clients===
 
{|class="wikitable"
*[http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1880261.html Java 7 Runtime Environment] (the [http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html Java 7 SDK] is also usable). There is one known issue that can be avoided by using Java 6 but it doesn't affect most users<sup>[http://forums.e-hentai.org/index.php?s=&showtopic=97152&view=findpost&p=2265428]</sup>.
|-
*3 Mbit/s burst upload speed or higher. Users may make limits on how much bandwidth is used per hour if they have a bandwidth cap (100 MB/hour minimum). This requirement varies from region to region.
!Requirement
*2 GB of hard drive space or higher.
!Notes
*[http://portforward.com/ An open port] (TCP only).
|-
*An additional IP address for each additional client (must be IPv4).
|[https://www.java.com/en/download/ Java Runtime Environment]
|
*Version 8 or newer
*The JDKs are also usable.
|-
|80+ Mbit/s measured speed
|
*At least 2500KB/s must be dedicated to H@H
*This applies to both upload and download.
|-
|1000 GB/month data transfer
|Users may limit how much data is used per month. Note that this limit is approximate.
|-
|10+ GiB of '''dedicated''' hard drive space
|
*SSDs are ideal; <span title="Disabling logging can reduce I/O even further" style="border-bottom:1px dotted">write endurance is not an issue</span>.
*At least 1 GiB for every <span title="25 KB/s " style="border-bottom:1px dotted">0.2 Mbit/s</span> is encouraged for optimal [[static range]] allocation.
*Please ensure the client can sustain both speed and disk I/O in the long run.
|-
|[https://portforward.com/ An open TCP port]
|
*443 recommended; otherwise must be between 1024-65534.
*[https://en.wikipedia.org/wiki/Ephemeral_port Unregistered IANA ports or UNIX kernel ports] are recommended as private ports. Check [https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers this list] for potential port conflicts.
*[[Technical_Issues#Ports|Some ports are not permitted]].
|-
|A unique IPv4 IP address
|1 per every operational client. Ideally should be static, or needs to be relatively stable (i.e. not change constantly).
|-
|Uptime
|A single client should remain online for at least 90% of the time over a 6 month period. Clients that have an unacceptable level of downtime will be [[Hentai@Home#Revocations|revoked]]. If a client remains offline for more than three months, it will be deleted and cannot be recovered.
|}


===Obtaining Client Keys===
===Obtaining Client Keys===
Users who are signing up for their first client simply go to the [[My_Home#Hentai.40Home | Hentai@Home page]] in their [[My Home]] area. A flash interface will appear where one may fill in their qualifications. Once submitted, simply wait a few days for approval.
Users wishing to sign up for their first client can apply from the [https://e-hentai.org/hentaiathome.php Hentai@Home page] in their [[My Home]] area. Applications are typically processed in less than a day.


To sign up for any additional clients, please [http://forums.e-hentai.org/index.php?act=Msg&CODE=4&MID=6 PM Tenboro]. For users wishing to run more than five clients the average quality of their existing clients must be stable above 7,500 before more keys can be assigned.
For any additional clients you will need to [https://forums.e-hentai.org/index.php?act=Msg&CODE=4&MID=6 PM Tenboro]. For users wishing to run more than 5 clients the average stable quality of their existing clients must be 7,000+ before more keys are assigned.


<div id="Installation"></div>
<div id="Installation"></div>
==Installation Guides==
==Installation Guides==
*[http://forums.e-hentai.org/index.php?showtopic=19795 Windows]
*[https://forums.e-hentai.org/index.php?showtopic=19795 Windows]
*[http://forums.e-hentai.org/index.php?showtopic=100453 FreeBSD with Jails]
*[https://forums.e-hentai.org/index.php?showtopic=100453 FreeBSD with Jails]
*[http://forums.e-hentai.org/index.php?s=&showtopic=19795&view=findpost&p=797807 Linux]
*[https://forums.e-hentai.org/index.php?showtopic=214602 Daemonizing H@H on BSD]
*[https://forums.e-hentai.org/index.php?s=&showtopic=19795&view=findpost&p=797807 Linux]
**[[Installing H@H on Ubuntu|Ubuntu]]
**[[Installing H@H on Ubuntu|Ubuntu]]
**[[Installing H@H on Debian|Debian]]
**[[Installing H@H on Debian|Debian]]
**[http://forums.e-hentai.org/index.php?showtopic=69880 Debian on Raspberry Pi]
**[https://forums.e-hentai.org/index.php?showtopic=69880 Debian on Raspberry Pi]
**[http://forums.e-hentai.org/index.php?showtopic=69887 Solaris]
**[https://forums.e-hentai.org/index.php?showtopic=69887 Solaris]
*[http://forums.e-hentai.org/index.php?showtopic=97809 Rented Server]
*[https://forums.e-hentai.org/index.php?showtopic=97809 Rented Server]
*[http://forums.e-hentai.org/index.php?showtopic=132751 Python Client]
*[https://forums.e-hentai.org/index.php?showtopic=132751 Python Client]


==Limits==
==Limits==
*Ports that can be used for H@H: 80 or any port between 1024-65534
A client's maximum burst speed (in KB/s) will determine the maximum number of connections that can be had simultaneously (up to 500 at 4800 KB/s or more).
**Exceptions: 2049, 3659, 4045, 6000, 6665-6669


A client's maximum burst speed will determine:
Simultaneous connections are determined by a client's hitrate and burst speed (during speed tests, the packet size is adjusted to match the client's burst speed).
*The maximum number of connections that can be had simultaneously (up to 500).
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}">'''Maximum connections (capped at 500)''' = 20 + max_burst_speed / 10000</pre>
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}">'''Maximum Connections''' = 20 + max_burst_speed / 10000</pre>


*The maximum disk cache size (in GBs).
The disk cache size (in GB) must be enough to maintain static ranges. Clients must be able to store 10 GB or 250 MB per static range at any given time, whichever is higher:
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}">'''Cache Size''' = max_burst_speed / 10</pre>
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}">'''Minimum cache size''' = max(10, static_ranges * 250 / 1024)</pre>


===Speed Test===
===Speed Test===
When the H@H client starts, it contacts one of the H@H main servers which tests the Internet connection of the client in order to check if it can upload data at the configured maximum burst speed. If it cannot the maximum burst speed is reduced internally to the measured upload speed in order to prevent the connection from being overloaded.  
When the H@H client starts, it contacts one of the H@H control servers which tests the connection of the client in order to check if it can upload data at the configured maximum burst speed. If it cannot, the maximum burst speed is reduced internally to the measured upload speed in order to prevent the connection from being overloaded.


It is possible for the measured upload speed to be significantly lower than real upload speed of the Internet connection, especially if that connection isn't located on the European continent (where the H@H main servers are located). In such a case the H@H client will be underused and its owner can request a speed test override from [http://forums.e-hentai.org/index.php?act=Msg&CODE=4&MID=6 Tenboro] by sending him proof that the Internet connection the H@H client runs on can upload at a higher speed than the measured speed (e.g. a screenshot of their [http://speedtest.net SpeedTest]'s results).
==Activity==
<div id="healthy"></div>A client is considered to be "healthy" if '''all''' of the following apply:
* The client '''must be running and not suspended'''.
* The client's '''[[#Trust|trust]] value must be above 0'''.
* The client must maintain a '''[[#Quality|quality]] of more than 2000'''.
* The client's tested speed must '''exceed 400 KB/s (for Asia clients) or 800 KB/s (for non-Asia clients)'''.
Failure to reach any of these requirements will make it idle on the network and wait until the requirements are reached.


==Scheduler==
==Data Transfer Cap==
Each client can be scheduled to use less than its maximum burst speed and bandwidth. These can be based on particular days but are limited to using precise times (every hour on the hour).
With each client, you may define a <i>Monthly Data Transfer Target</i> from the client's settings page (under the "Advanced Settings" section). This will help to prevent H@H from using more data than the monthly cap set by your ISP.
*If the system detects that you are likely to exceed this target, it will reduce the [[Hentai@Home#Priority_Ranges|priority]] of ranges on your client to reduce the load, but it is not guaranteed to stay below this value.
*The value must be at least 1000 GB if set.
*If a limit is set, '''the [[static range]] allocation of that client will be limited to 1 per 5 GB.'''
**<span style="color:#ff0000">'''If set below 5000 GB/month, the client will not be assigned any [[Hentai@Home#High-Capacity_Ranges|high-capacity ranges]], and all previously assigned high-capacity ranges will be removed ''immediately''.'''</span>


==Software==
==Software==
A few command line switches may be given to the H@H application in order to change some of its behaviors:
A few command line switches may be given to the H@H application in order to change some of its behaviors:
:--disable_bwm
:<tt>--disable_bwm</tt>
::Disables the bandwidth monitor which is the part that makes sure the H@H application does not use more upload speed than the value of the "Maximum Burst Speed" parameter. When the bandwidth monitor is disabled, the H@H dispatcher will still respect the "Maximum Burst Speed" parameter so that the <u>mean</u> upload speed of the H@H application won't exceed the value of that parameter. However, the H@H application might use as much upload speed as the Internet connection on which it runs can provide in order to send image files, which generally results in upload peaks.
::(''Can also be set from the client's settings page'')
::In some cases, the bandwidth monitor is unable to use the whole maximum upload speed that has been set, which can result in an under-utilization of the H@H application upload speed (and might trigger false overload notifications). In such cases, it is better to disable the bandwidth monitor in order for the H@H application to give better performances.
::Disables the bandwidth monitor, which prevents the client from using more upload speed than the value of the "Maximum Burst Speed" parameter. The H@H dispatcher will still respect the "Maximum Burst Speed" parameter so that the <u>mean</u> upload speed of the client won't exceed that value. However, the client might use as much upload speed as its connection provides in order to send files, which generally results in upload peaks.
:--disable_logging
::In some cases, the bandwidth monitor is unable to use the whole maximum upload speed that has been set, which can result in an under-utilization of the client's upload speed (and might trigger false overload notifications). In such cases, it is better to disable the bandwidth monitor in order for the client to give better performance.
::Disables the writing of log entries in the ''log_out'' file. Enabling this switch might increase the performance of the application by reducing its I/O usage.
:<tt>--disable_logging</tt>
:--force_dirty
::(''Can also be set from the client's settings page'')
::Forces a check of the database for errors (as if the database was dirty).
::Disables the opening, creation, and writing to the ''log_out'' file. This will significantly reduce I/O for HDD but make network troubleshooting harder. Java errors will still be logged to ''log_err''.
:--max_connections=''conn''
:<tt>--flush-logs</tt>
::Sets the maximum number of connections the application can handle to ''conn''. The default maximum number of connections depends on the max burst speed parameter, and is computed as detailed above. In some rare circumstances the default value is too low and the maximum number of connections needs to be increased slightly in order to avoid triggering false overload notifications. Setting this value to a too high limit might have severe consequences on a client's performance, and impact the whole H@H network badly. '''DO NOT CHANGE THIS VALUE UNLESS YOU ABSOLUTELY KNOW WHAT YOU ARE DOING'''!
::Flushes the log to disk for every written line. This will increase I/O; mostly recommended for when the log is written to a ramdisk.
:--silentstart
:<tt>--max_connections=''conn''</tt>
::Starts the UI in minimized mode (tray icon).
::Sets the maximum number of connections the application can handle to ''conn''. The default maximum number of connections depends on the max burst speed parameter, as detailed above. In some rare circumstances the default value is too low and the maximum number of connections needs to be increased slightly in order to avoid triggering false overload notifications. Setting this value too high might have severe consequences on a client's performance and impact the whole H@H network badly. '''DO NOT CHANGE THIS VALUE UNLESS YOU ABSOLUTELY KNOW WHAT YOU ARE DOING!'''
:--skip_free_space_check
:<tt>--port</tt>
::Overrides the port set in the client's settings. For example, one may use this option and the following iptables rules to allow running H@H on one port officially (in the [https://e-hentai.org/hentaiathome.php settings page]) whilst binding or tunneling a completely different port.  One potential use case cloud be: configure H@H in the setting to start on port <tt>443</tt> (HTTPS), then use <tt>--port=7777</tt> with the following iptables rules:
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}">iptables -A INPUT -p tcp --dport 443 -j ACCEPT
iptables -A INPUT -p tcp --dport 7777 -j ACCEPT
iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 7777</pre>
:<tt>--rescan-cache</tt>
::Checks the cache for errors.
:<tt>--silentstart</tt>
::Starts the UI in minimized mode / tray icon.
:<tt>--skip_free_space_check</tt>
::Disables the free space check so that the application won't err if the space left on the partition that contains the ''cache'' folder is less than the configured parameter (or 100MB if that parameter is set to a value less than 100MB).
::Disables the free space check so that the application won't err if the space left on the partition that contains the ''cache'' folder is less than the configured parameter (or 100MB if that parameter is set to a value less than 100MB).
:--use_more_memory
:<tt>--verify_cache</tt>
::Allows the application to use more memory in order to increase its performances (by reducing the number of I/O operations). More specifically, the application will use more memory when building the cached files list, sending the file's content, and it will use a memory cache in order to reduce the number of times the files' access timestamps are updated in the database.
::(''Can also be requested from the client's settings page'')
:--verify_cache
::Forces a check of the entire cache. This is the same as <tt>--rescan-cache</tt> with the addition that the SHA-1 hash of each file is also checked; this can take a long time.
::Forces a check of the entire cache. This is the same as --force_dirty, except that the content of each file in the cache is also checked (which can take a lot of time).
:<tt>--disable-ip-origin-check</tt>
:-xmx''mem''m
::Disables the requirement that RPC server requests come from a whitelisted IP. Using this is discouraged as it reduces security, but may allow the client to work in some common non-transparent proxy configurations.
::Limits the use of memory to ''mem'' (in MB).
:<tt>--disable-flood-control</tt>
::Disables the rate limit on connections per IP address. May be necessary to use with the above trigger.
 
===Directories===
:<tt>--cache-dir</tt>
:<tt>--data-dir</tt>
:<tt>--download-dir</tt>
:<tt>--log-dir</tt>
:<tt>--temp-dir</tt>
 
These arguments allow for changes to the locations of these directories. Quotes are required if there are spaces in the path. H@H will attempt to create the directory if it does not exist. Only ''log'' and ''temp'' may share a directory.
 
Examples:
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}">'''Windows''': --download-dir="c:\some download dir with spaces\"
'''Linux''': --cache-dir=/some/cache/location --temp-dir=/dev/shm/hath --log-dir=/dev/shm/hath</pre>


==Cache==
==Cache==
The system will fill the cache will recently in-demand files and will delete least recently used files once it fills up to the set capacity. It is important for users not to manually tamper with any files in the cache as this will cause major trust and cache database issues for the client.
The system fills a client's cache exclusively with [[#Static Ranges|static ranges]] of files. Users should '''not''' tamper with any of these files; this will cause major [[#Trust|trust]] and cache database issues for the client. Corrupted files will be deleted and replaced if requested.
 
===Static Ranges===
Static ranges each correspond to 1/65536th of the site's content. The server will always assume that the client is able to serve files from that range without tracking the files individually. If a ranged file isn't currently cached the client will proxy-request it from the image servers on-demand and store it for later use.
 
The assignment of static ranges for a particular region is based on a scoring algorithm. It generally prioritizes new clients or clients with few ranges, assuming all other factors (e.g., tested speed) are similar across clients. If a static range has only been assigned to less than the desired number of clients or a below-average number of clients, the range in question will be assigned to an available client.
 
Static ranges are divided into priority levels, where P1, P2 and P3 are considered "active" ranges. The network will first attempt to request a file from a P1 client, and then fall back to clients with a lower priority if the initial client(s) fail to serve the file.
 
The final priority level P4 is for "dead" ranges that previously active ranges can be demoted to, for example if the client if offline for an extended period of time.
 
To receive the most P1 ranges, the client should maintain a high tested speed and [[quality]] value, and have as high uptime as possible. Clients that experienced recent overloads will be less likely to be assigned with P1 ranges.
 
Clients cannot be assigned more ranges if they fail the minimum [[Hentai@Home#Trust|trust]], [[quality]], current/previous session runtime, or tested speed requirements.
 
====High-Capacity Ranges====
Static ranges can also be promoted into High-Capacity (HC) ranges, in which the client will be used to serve large and original quality files of that range.
 
To receive any HC ranges assignment, clients must meet more stringent requirements:
*Must be located in one of the three major regions with surplus capacity. i.e., Europe, North America, or Asia (excluding mainland China)
*Must have at least 10000 KB/s throttle and 8000 KB/s tested speed
*Must have the [[Hentai@Home#Data_Transfer_Cap|monthly bandwidth limit]] set to either unlimited (0) or at least 10000 GB/month
*Must have at least 100 GB of disk space assigned
 
The maximum number of HC ranges that a client can have is limited to 1 per 1 GiB of reserved disk space. <span style="color:#ff0000">'''You will lose all of your assigned HC ranges if you set a [[Hentai@Home#Data_Transfer_Cap | data transfer cap]] below 5000 GB/month or reduce the maximum upload rate below 10000 KB/s.'''</span> The traffic estimates for calculating Hathrate will also be reset.
 
Due to their surplus cache capacity, clients with a low ratio of P1 ranges will be preferred for HC range promotions. '''Do NOT attempt to avoid P1 assignments for the sake of gaining HC ranges''', as they are still preferable over HC ranges.
 
Note that HC ranges are set independently of priority, meaning a static range can both have a priority of P1 and be set as an HC range.


==Trust==
==Trust==
Trust merely indicates how well the client is performing according to other clients<sup>[http://forums.e-hentai.org/index.php?s=&showtopic=40925&view=findpost&p=1210510][http://forums.e-hentai.org/index.php?s=&showtopic=115037&view=findpost&p=2464003]</sup>. Trust slowly goes up if the client is behaving normally, even if it is not serving files. Negative trust often occurs from improper shutdowns or bad connections. Trust caps at +1000.
Trust indicates how well the client is performing according to other clients.
*Trust caps at +1000 and gradually rises by 1-4 per minute if the client is behaving normally, even if it is not serving files.
*Negative trust often occurs from improper shutdowns, bad connections, or having a higher than expected number of cache misses.


==Quality==
==Quality==
Quality measures the long-term overall stability and reliability of a client up to a value 10,000. It prioritizes clients  for file requests (along with raw speed and proximity factors).
Quality measures the long-term overall stability and reliability of a client, calculated by comparing the client's average failure rate to the average failure rate of the region. It influences the assignment/promotion of [[static range]]s, as well as the allocation of traffic.
*New clients and clients that have been unused for several days will start out with 0 quality; it can take several days for it to stabilize at the baseline value.
*If the client's average failure rate is the same as the regional average, the quality metric will be at 9000. To achieve maximum quality (i.e., 10000), the client would need to have less than half the failure rate compared to the average.
*What constitutes a decent quality rating varies between geographical regions.
*If the quality drops below 2000, the client will stop receiving traffic until it recovers.
*New clients with minimal traffic may experience some fluctuations in the value, but this will stabilize over time.
*Due to the quirkiness of the region, clients located within the Chinese Dominion region (i.e., mainland China) do not use the quality metric. The value output is locked at 10000 on the user end.


==[[Rewards]]==
==[[Rewards]]==
Users receive 1 [[GP]] for each hit on their client, as well as be able to compete for a position on the [[Toplists#Hentai.40Home_Toplists|H@H toplist]].
Users receive 1 [[GP]] for each hit on their client and may compete for a position on the [[Toplists#Hentai.40Home_Toplists|H@H toplist]]. While running [[Hentai@Home#healthy|healthy]] H@H clients, users receive [[Hath]] which can be used to purchase [[Hath Perks]].


The currency known as [[Hath]] is also be generated (calculated roughly every minute), which can be used to purchase [[Hath Perks]]. The minimum speed required to earn hath is 40 KB/s. The maximum amount that can be earned per day per client is 20 hath (this requires a rate of 300+ hits per minute).
The daily [[Hath]] earned per client is based on the following formula:
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}">'''Hathrate/day''' = 1 + 0.15 * max(hits_per_minute, KB_served_per_minute / 420) + 0.025 * active_rangecount + 0.05 * hicap_rangecount</pre>
*The contribution from assigned ranges is capped by the client's tested speed. The cap is set to <tt>tested_speed / 100 KB/s</tt>.
*The [[Hath]] is made available roughly every 4 hours the client has been running.
*Only [[Hentai@Home#healthy|healthy]] clients which current or previous session '''lasted for at least 24 hours straight''' will generate [[Hath]].
*Clients will not receive any [[Hath]] if the [[Hentai@Home#Quality|quality]] drops below 2000.


===H@H Image Proxy===
===H@H Downloader===
To use H@H as a proxy for the [[galleries]], users simply need to enable it through their [[My_Home#My_Settings|My Settings]] page. This enables any images viewed in galleries to be loaded through the H@H client. As such, these images are added to the user's H@H cache, making them instantly (re)viewable as long as they remain cached.
''For more information, please check [https://forums.e-hentai.org/index.php?showtopic=196195 this thread].''


===Hentai@Home Downloader===
An H@H client can be used to download [[archive]]s (instead of via HTTPS).
Users can utilize an H@H client to [[download]] [[galleries]] as a alternative to [[Doggie Bag]]ging or [[torrents]]. This method does not cost any [[credits]] or [[GP]].
* Resolution options include 780x, 980x, 1280x, 1600x, 2400x, or original (availability may differ).
* Once queued there is no way to prevent the client from downloading the gallery.
* A ''galleryinfo.txt'' file is generated upon completed unlike [[archive]] downloading.
* [[Archives#Filenames|Filename changes]] still occur.
* These downloads still cost [[GP]]/[[credits]] ([[#Free_Archives|see below for exceptions]]).
* The download queue is server-side and as such is not affected by client-side interruptions. It will resume if the client is restarted. Queued downloads aren't pruned unless the client fails to download them for a full week. The client will verify that the downloaded file has the expected hash at completion.


====How-To====
====Free [[Archives]]====
# Make sure that an H@H client has been running properly for at least 1 hour (add 15 minutes if coming out of a suspend) and has positive [[#Trust|trust]].
[[Hentai@Home#healthy|Healthy]] clients with its current or previous session '''lasted for at least 24 hours straight''' earn a quota of 1,000 MB/day in free [[archive]] downloads. An additional 10 MB/day is earned per adjusted average hit.
# In the desired gallery click the "Hentai@Home Downloader" link on the right-side column.
* This quota is measured over a 7-day sliding window.
# Save the ".hathdl" file in the "hathdl" subdirectory found under the H@H directory.
* [[Archives#Costs|Recreated archives]] do NOT qualify.
* Extra clients do NOT earn another 1,000 MB.
* The amount a user has earned can be found on their H@H client list page at the bottom of the "Your Active Clients" section.


Multiple galleries can be downloaded automatically over time (will be done in the order that the .hathdl files were added). As a gallery is being downloaded it will be saved in the "downloaded" subdirectory. When it is finished a file named "galleryinfo.txt" will be placed in the folder with the most current information for the gallery. The client will attempt to download from other H@H clients first but if this fails for 3 attempts it will pull the images from E-Hentai's image servers.
==Revocations==
Clients that fail to adhere to the uptime requirements by a significant margin or have their cache/ranges regularly cleared will be revoked. Revoked clients can no longer be used and will be deleted after the three month grace period.


====Notes====
Depending on what led to the revocation, revoked clients can sometimes be reactivated. You would need a very good reason for this to happen, and this will be decided on a case by case basis. "I did not read the requirements on the signup page nor the multiple automated warnings I received" is not a good reason.
*The speed at which H@H downloads files varies based on the time the client has been online and the rate at which it has served files.
*Only the down-sampled pictures available from the E-Hentai server are downloaded, not the high quality images available from the other [[downloading]] options.
*Downloaded files '''do''' count against a user's daily image viewing limit. If the limit is hit the client will request extensions in blocks of 100 images costing the user 100 [[GP]] each time this occurs.
*This does not match the effect of the [[#H@H Image Proxy|H@H Image Proxy]] in the long-term. Files in the "downloaded" folder are not utilized when viewing galleries on the site but they are likely to be loaded from the "cache" folder since the client also copies them there during the downloading process.


=====Folder Filenames=====
If your client is revoked, you will not be able to re-apply to H@H in the future.
*Will always end with the gallery ID in square brackets.
*Any characters in excess of the first 100 will be replaced by an ellipsis (not including the gallery ID).
*Some characters will be changed to their HTML escape equivalents (e.g. ' -> &amp;#039;)
 
'''Example''':
The gallery [http://g.e-hentai.org/g/584539/ec70d28127/ http://g.e-hentai.org/g/584539/ec70d28127/] will create the following folder name: "[Drill Chichikuri (Warugaki)] Green - Ganbare! (Cry) Kogasa-chan!! ~Return~  Green - Do your Best... [584539]"


==See also==
==See also==
*[[Hentai@Home FAQ|FAQ - Hentai@Home]]
*[[Technical_Issues#H.40H|Technical Issues - H@H]]
*[[Hath]]
*[[Hath]]
*[[Doggie Bag]]
*[[Downloading]]
*[[EHTracker]]
*[[Renting A Seedbox]]
*[[Renting A Seedbox]]
*[[Technical_Issues#H.40H|Technical Issues - H@H]]


==Forum Links==
==Forum Links==
*[http://forums.e-hentai.org/index.php?s=&showtopic=117291&view=findpost&p=2493908 How quality is measured]
*[https://forums.e-hentai.org/index.php?showtopic=19795 H@H FAQ topic]
*[https://forums.e-hentai.org/index.php?s=&showtopic=101296&view=findpost&p=2336526 Running H@H as a Service]
*[https://forums.e-hentai.org/index.php?showtopic=238973&st=0&p=5695501&#entry5695501 Tenboro's post detailing the limitations regarding the allocation of static ranges]


{{Template:EHGNav}}
{{Template:EHGNav}}


[[Category:E-Hentai Galleries]][[Category:Site Features]]
[[Category:E-Hentai Galleries]][[Category:Site Features]]

Latest revision as of 08:24, 18 March 2026

Hentai@Home (H@H) is an open-source Peer-2-Peer gallery distribution system which reduces the load on the E-Hentai Galleries. The current version can be found in the update announcement thread.

The client UI (maximized)
The client list UI

General Information

H@H is a project that can be compared to a cross between the SETI@home project and BitTorrent.

All participating users run a small Java-based client that downloads files from the main E-Hentai servers to their computer and passes those files on to people who browse the E-Hentai Galleries. This allows E-Hentai to serve many more images using less server bandwidth.

Signing Up

The H@H application form.

Minimum Requirements For New Clients

Requirement Notes
Java Runtime Environment
  • Version 8 or newer
  • The JDKs are also usable.
80+ Mbit/s measured speed
  • At least 2500KB/s must be dedicated to H@H
  • This applies to both upload and download.
1000 GB/month data transfer Users may limit how much data is used per month. Note that this limit is approximate.
10+ GiB of dedicated hard drive space
  • SSDs are ideal; write endurance is not an issue.
  • At least 1 GiB for every 0.2 Mbit/s is encouraged for optimal static range allocation.
  • Please ensure the client can sustain both speed and disk I/O in the long run.
An open TCP port
A unique IPv4 IP address 1 per every operational client. Ideally should be static, or needs to be relatively stable (i.e. not change constantly).
Uptime A single client should remain online for at least 90% of the time over a 6 month period. Clients that have an unacceptable level of downtime will be revoked. If a client remains offline for more than three months, it will be deleted and cannot be recovered.

Obtaining Client Keys

Users wishing to sign up for their first client can apply from the Hentai@Home page in their My Home area. Applications are typically processed in less than a day.

For any additional clients you will need to PM Tenboro. For users wishing to run more than 5 clients the average stable quality of their existing clients must be 7,000+ before more keys are assigned.

Installation Guides

Limits

A client's maximum burst speed (in KB/s) will determine the maximum number of connections that can be had simultaneously (up to 500 at 4800 KB/s or more).

Simultaneous connections are determined by a client's hitrate and burst speed (during speed tests, the packet size is adjusted to match the client's burst speed).

Maximum connections (capped at 500) = 20 + max_burst_speed / 10000

The disk cache size (in GB) must be enough to maintain static ranges. Clients must be able to store 10 GB or 250 MB per static range at any given time, whichever is higher:

Minimum cache size = max(10, static_ranges * 250 / 1024)

Speed Test

When the H@H client starts, it contacts one of the H@H control servers which tests the connection of the client in order to check if it can upload data at the configured maximum burst speed. If it cannot, the maximum burst speed is reduced internally to the measured upload speed in order to prevent the connection from being overloaded.

Activity

A client is considered to be "healthy" if all of the following apply:

  • The client must be running and not suspended.
  • The client's trust value must be above 0.
  • The client must maintain a quality of more than 2000.
  • The client's tested speed must exceed 400 KB/s (for Asia clients) or 800 KB/s (for non-Asia clients).

Failure to reach any of these requirements will make it idle on the network and wait until the requirements are reached.

Data Transfer Cap

With each client, you may define a Monthly Data Transfer Target from the client's settings page (under the "Advanced Settings" section). This will help to prevent H@H from using more data than the monthly cap set by your ISP.

  • If the system detects that you are likely to exceed this target, it will reduce the priority of ranges on your client to reduce the load, but it is not guaranteed to stay below this value.
  • The value must be at least 1000 GB if set.
  • If a limit is set, the static range allocation of that client will be limited to 1 per 5 GB.
    • If set below 5000 GB/month, the client will not be assigned any high-capacity ranges, and all previously assigned high-capacity ranges will be removed immediately.

Software

A few command line switches may be given to the H@H application in order to change some of its behaviors:

--disable_bwm
(Can also be set from the client's settings page)
Disables the bandwidth monitor, which prevents the client from using more upload speed than the value of the "Maximum Burst Speed" parameter. The H@H dispatcher will still respect the "Maximum Burst Speed" parameter so that the mean upload speed of the client won't exceed that value. However, the client might use as much upload speed as its connection provides in order to send files, which generally results in upload peaks.
In some cases, the bandwidth monitor is unable to use the whole maximum upload speed that has been set, which can result in an under-utilization of the client's upload speed (and might trigger false overload notifications). In such cases, it is better to disable the bandwidth monitor in order for the client to give better performance.
--disable_logging
(Can also be set from the client's settings page)
Disables the opening, creation, and writing to the log_out file. This will significantly reduce I/O for HDD but make network troubleshooting harder. Java errors will still be logged to log_err.
--flush-logs
Flushes the log to disk for every written line. This will increase I/O; mostly recommended for when the log is written to a ramdisk.
--max_connections=conn
Sets the maximum number of connections the application can handle to conn. The default maximum number of connections depends on the max burst speed parameter, as detailed above. In some rare circumstances the default value is too low and the maximum number of connections needs to be increased slightly in order to avoid triggering false overload notifications. Setting this value too high might have severe consequences on a client's performance and impact the whole H@H network badly. DO NOT CHANGE THIS VALUE UNLESS YOU ABSOLUTELY KNOW WHAT YOU ARE DOING!
--port
Overrides the port set in the client's settings. For example, one may use this option and the following iptables rules to allow running H@H on one port officially (in the settings page) whilst binding or tunneling a completely different port. One potential use case cloud be: configure H@H in the setting to start on port 443 (HTTPS), then use --port=7777 with the following iptables rules:
iptables -A INPUT -p tcp --dport 443 -j ACCEPT
iptables -A INPUT -p tcp --dport 7777 -j ACCEPT
iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 7777
--rescan-cache
Checks the cache for errors.
--silentstart
Starts the UI in minimized mode / tray icon.
--skip_free_space_check
Disables the free space check so that the application won't err if the space left on the partition that contains the cache folder is less than the configured parameter (or 100MB if that parameter is set to a value less than 100MB).
--verify_cache
(Can also be requested from the client's settings page)
Forces a check of the entire cache. This is the same as --rescan-cache with the addition that the SHA-1 hash of each file is also checked; this can take a long time.
--disable-ip-origin-check
Disables the requirement that RPC server requests come from a whitelisted IP. Using this is discouraged as it reduces security, but may allow the client to work in some common non-transparent proxy configurations.
--disable-flood-control
Disables the rate limit on connections per IP address. May be necessary to use with the above trigger.

Directories

--cache-dir
--data-dir
--download-dir
--log-dir
--temp-dir

These arguments allow for changes to the locations of these directories. Quotes are required if there are spaces in the path. H@H will attempt to create the directory if it does not exist. Only log and temp may share a directory.

Examples:

Windows: --download-dir="c:\some download dir with spaces\"
Linux: --cache-dir=/some/cache/location --temp-dir=/dev/shm/hath --log-dir=/dev/shm/hath

Cache

The system fills a client's cache exclusively with static ranges of files. Users should not tamper with any of these files; this will cause major trust and cache database issues for the client. Corrupted files will be deleted and replaced if requested.

Static Ranges

Static ranges each correspond to 1/65536th of the site's content. The server will always assume that the client is able to serve files from that range without tracking the files individually. If a ranged file isn't currently cached the client will proxy-request it from the image servers on-demand and store it for later use.

The assignment of static ranges for a particular region is based on a scoring algorithm. It generally prioritizes new clients or clients with few ranges, assuming all other factors (e.g., tested speed) are similar across clients. If a static range has only been assigned to less than the desired number of clients or a below-average number of clients, the range in question will be assigned to an available client.

Static ranges are divided into priority levels, where P1, P2 and P3 are considered "active" ranges. The network will first attempt to request a file from a P1 client, and then fall back to clients with a lower priority if the initial client(s) fail to serve the file.

The final priority level P4 is for "dead" ranges that previously active ranges can be demoted to, for example if the client if offline for an extended period of time.

To receive the most P1 ranges, the client should maintain a high tested speed and quality value, and have as high uptime as possible. Clients that experienced recent overloads will be less likely to be assigned with P1 ranges.

Clients cannot be assigned more ranges if they fail the minimum trust, quality, current/previous session runtime, or tested speed requirements.

High-Capacity Ranges

Static ranges can also be promoted into High-Capacity (HC) ranges, in which the client will be used to serve large and original quality files of that range.

To receive any HC ranges assignment, clients must meet more stringent requirements:

  • Must be located in one of the three major regions with surplus capacity. i.e., Europe, North America, or Asia (excluding mainland China)
  • Must have at least 10000 KB/s throttle and 8000 KB/s tested speed
  • Must have the monthly bandwidth limit set to either unlimited (0) or at least 10000 GB/month
  • Must have at least 100 GB of disk space assigned

The maximum number of HC ranges that a client can have is limited to 1 per 1 GiB of reserved disk space. You will lose all of your assigned HC ranges if you set a data transfer cap below 5000 GB/month or reduce the maximum upload rate below 10000 KB/s. The traffic estimates for calculating Hathrate will also be reset.

Due to their surplus cache capacity, clients with a low ratio of P1 ranges will be preferred for HC range promotions. Do NOT attempt to avoid P1 assignments for the sake of gaining HC ranges, as they are still preferable over HC ranges.

Note that HC ranges are set independently of priority, meaning a static range can both have a priority of P1 and be set as an HC range.

Trust

Trust indicates how well the client is performing according to other clients.

  • Trust caps at +1000 and gradually rises by 1-4 per minute if the client is behaving normally, even if it is not serving files.
  • Negative trust often occurs from improper shutdowns, bad connections, or having a higher than expected number of cache misses.

Quality

Quality measures the long-term overall stability and reliability of a client, calculated by comparing the client's average failure rate to the average failure rate of the region. It influences the assignment/promotion of static ranges, as well as the allocation of traffic.

  • If the client's average failure rate is the same as the regional average, the quality metric will be at 9000. To achieve maximum quality (i.e., 10000), the client would need to have less than half the failure rate compared to the average.
  • If the quality drops below 2000, the client will stop receiving traffic until it recovers.
  • New clients with minimal traffic may experience some fluctuations in the value, but this will stabilize over time.
  • Due to the quirkiness of the region, clients located within the Chinese Dominion region (i.e., mainland China) do not use the quality metric. The value output is locked at 10000 on the user end.

Rewards

Users receive 1 GP for each hit on their client and may compete for a position on the H@H toplist. While running healthy H@H clients, users receive Hath which can be used to purchase Hath Perks.

The daily Hath earned per client is based on the following formula:

Hathrate/day = 1 + 0.15 * max(hits_per_minute, KB_served_per_minute / 420) + 0.025 * active_rangecount + 0.05 * hicap_rangecount
  • The contribution from assigned ranges is capped by the client's tested speed. The cap is set to tested_speed / 100 KB/s.
  • The Hath is made available roughly every 4 hours the client has been running.
  • Only healthy clients which current or previous session lasted for at least 24 hours straight will generate Hath.
  • Clients will not receive any Hath if the quality drops below 2000.

H@H Downloader

For more information, please check this thread.

An H@H client can be used to download archives (instead of via HTTPS).

  • Resolution options include 780x, 980x, 1280x, 1600x, 2400x, or original (availability may differ).
  • Once queued there is no way to prevent the client from downloading the gallery.
  • A galleryinfo.txt file is generated upon completed unlike archive downloading.
  • Filename changes still occur.
  • These downloads still cost GP/credits (see below for exceptions).
  • The download queue is server-side and as such is not affected by client-side interruptions. It will resume if the client is restarted. Queued downloads aren't pruned unless the client fails to download them for a full week. The client will verify that the downloaded file has the expected hash at completion.

Free Archives

Healthy clients with its current or previous session lasted for at least 24 hours straight earn a quota of 1,000 MB/day in free archive downloads. An additional 10 MB/day is earned per adjusted average hit.

  • This quota is measured over a 7-day sliding window.
  • Recreated archives do NOT qualify.
  • Extra clients do NOT earn another 1,000 MB.
  • The amount a user has earned can be found on their H@H client list page at the bottom of the "Your Active Clients" section.

Revocations

Clients that fail to adhere to the uptime requirements by a significant margin or have their cache/ranges regularly cleared will be revoked. Revoked clients can no longer be used and will be deleted after the three month grace period.

Depending on what led to the revocation, revoked clients can sometimes be reactivated. You would need a very good reason for this to happen, and this will be decided on a case by case basis. "I did not read the requirements on the signup page nor the multiple automated warnings I received" is not a good reason.

If your client is revoked, you will not be able to re-apply to H@H in the future.

See also

Forum Links

E-Hentai Galleries Navigation
Finding Gallery SearchingBounty SystemFavoritesMaking Requests
Directory AnthologiesArtist Recommendations
Uploading Making GalleriesGallery CategoriesGallery ManagerGallery Descriptions
Downloading ArchivesHentai@HomeEHTracker
User Actions Tagging Fetish ListingKnow The DifferenceMechanics (Namespaces, Tag Creation)My TagsNew Tags
Other CommentingExpungingMod PowerRatingRenamingReporting
Rewards CreditsGallery PointsHath PerksToplists
Viewing Lo-FiMulti-Page Viewer
System APIBansFAQMy HomeTechnical Issues