'; break; default: $ unit = 'unknown unit';} return sprintf ('%. 2f ', $ B ). $ unit ;}}
Call:
echo formatSize('20667564');
The result is:
19.71MB
Note:
Here, the $ B parameter is a number in the unit of B, and $ times is used to identify the number of recursion of this function.
For the unit TB, PB, EB, and ZB that are not commonly used, refer to the following remarks (from the network ):
1 bit (this bit represents a binary number) 1 Byte (this word is also called "bit" but represents a he
PHP obtains the folder size function usage instance. PHP getting folder size function usage example this article describes PHP getting folder size function usage. Share it with you for your reference. The details are as follows :? Getting folder size f PHP getting folder size function usage example
This example describes how to use PHP to obtain the folder size function. Share it with you for your reference. The details are as follows:
?
// Get the folder size
Function getDirSize ($ dir)
{
$ Ha
Ceph is a fully open source distributed storage solution, a network block device, and a file system with high stability, high performance, and high scalability to handle data volumes from terabyte to exabyte levels.By using innovative scheduling algorithms (CRUSH), active storage nodes, and Peer-to-peer gossip protocols, Ceph avoids the problems of scalability and reliability in traditional centralized control and lookup table.Ceph is highly regarded
The approximate program idea is to use the recursive rules to calculate the amount of space occupied by the directory, and then the value of the space to write into the text file, so long as the access to the TXT file will know how much space occupied, do not have to read the disk frequently, save resources. Each time a user uploads a file or deletes a file, it is re-counted. Of course, you can also save the statistical results in the database.
Copy CodeThe code is as follows:
function Countdir
sprintf ('%.2f ', $b). $unit;}}
Call:Copy the Code code as follows: Echo formatsize (' 20667564 ');The result is:
19.71MB
Description
Where the parameter $b is a number in B, $times is used to identify how many times the function is recursive.
The non-commonly used units TB, PB, EB, ZB please refer to the following notes (from the network):
1bit (this bit represents a binary number)1Byte (this word is also called "bit") but it represents a hexadecimal number.1b=1byte=8bit1 KB = 1024x768 B (kb-k
Storage capacity: Is the maximum number of data that can be stored on the storage device, typically using kilobytes (KB kilobyte), megabytes (MB megabyte), gigabytes (GB, gigabyte), terabytes (TB, terabyte), and Pb (Petabyte), EB ( Exabyte), etc. to measure.1Byte (equivalent to an English letter, a kanji account of 2 byte)1kb=2 (b=1024b); Quite a short story.1mb=2 (kb=1024kb=2) B; Quite the text of a short story1gb=2 (Ten) mb=1024mb=2 (B). The content
How to Microsoft does SharePoint governance for their internal platform中文版 sources from:http://www.balestra.be/2012/04/ How-microsoft-does-sharepoint-governance-for-their-internal-platform.htmlApril 5th, 2012 | Posted by Marijn in community | Governance | MicrosoftA few months ago, Microsoft IT released a document (and webcast) that describes the extra effort they t Ook to balance their SharePoint implementation.In short, they had following problems with their platform:1.Environment was gr
licensesThis software offers multiple metering options:Traditional Symatec NetBackup licensing determines license quantity per server, per client, etcSymantec NetBackup Platform Capacity Licensing, both complete Edition and NDMP Edition, determine license quantity per fro Nt-end terabyte and drive.License Meter ChangesSymantec Netbackup Data Protection optimization Option Front End GB would no longer be offered.Customers who had 250GB has been upgrad
';
Switch ($ times ){
Case '0': $ unit = 'B'; break;
Case '1': $ unit = 'kb'; break;
Case '2': $ unit = 'mb'; break;
Case '3': $ unit = 'gb'; break;
Case '4': $ unit = 'tb'; break;
Case '5': $ unit = 'petab'; break;
Case '6': $ unit = 'EB '; break;
Case '7': $ unit = 'zb'; break;
Default: $ unit = 'unknown unit ';
}
Return sprintf ('%. 2f', $ B). $ unit;
}
}
Call:
The Code is as follows:Echo formatSize ('000000 ');
The result is:
19.71 MB
Note:
Here, the $ B parameter is a number in the uni
disassembled by default.025 026-c, -- show-children027 Show a DIE's children when using the -- debug-info = OFFSET, -- find, 028 and -- name options.029 030 -- eh-frame [= SECTION] 031 Dump exception handling fra Me information from the optional SECTION032 parameter. the _ eh_frame section will be dumped by default.033 034-e, -- english035 Print dwarf tags and attributes in a more readable format instead036 of using the dwarf tag _ and AT _ definitions.037 038 -- file-stats [= size] 039 Show fi
is spring? The first season of my life is notHere are some of the basic rules and algorithms that Lucene uses. The choice of these rules and algorithms is related to Lucene and a terabyte-capable inverted index.Prefix suffix rule (prefix+suffix): In Lucene's reverse index, to save the information of the dictionary, all the words in the dictionary are sorted in dictionary order, and then the dictionary contains almost all the words in the document, an
The example in this article describes the use of PHP to get folder size functions. Share to everyone for your reference. Specifically as follows:
?
Get folder Size
function Getdirsize ($dir)
{
$handle = Opendir ($dir);
while (false!== ($FolderOrFile = Readdir ($handle)))
{
if ($FolderOrFile!= "." $FolderOrFile!= "...")
{
if (Is_dir ("$dir/$FolderOrFile"))
{
$sizeResult + + getdirsize ("$dir/$FolderOrFile");
}
Else
{
$sizeResult + + filesize ("$dir/$FolderOrFile");
}
}
}
Clos
Exposure to computers all day, inevitably with a variety of measurement units to deal with, especially data, but you know bit, Byte, KB, GB, TB and so on all means how much data? Have you heard of EB, ZB, YB?
Bit (bit) is the initials of binary digit, the unit that measures information, and the smallest unit that represents the amount of content, only 0 or 12 binary states. 8 bits make up a byte (byte), can hold an English character, and a Chinese character requires two bytes of storage space,
Market power
In recent years, the web and businesses have witnessed data inflation. There are a number of reasons for this, for example, the commercialization of inexpensive terabyte-level storage hardware, which has been close to critical enterprise data over time, and the criteria for allowing easy information availability and exchange.
From an enterprise perspective, growing information is hard to store in standard relational databases or even da
system optimization operation.
Reorganizing the physical location of a data center server, such as configuring a cold and hot channel, can significantly reduce the load on the cooling system. Plugging away holes that cause cooling effects to decrease.
4. Upgrade Data storage
Data storage is one of the main reasons for the large power consumption in data center. Updating the storage system can also significantly reduce this power expenditure. In general, new disks are more energy efficient th
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.